- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {Charset c =
String charsetName;Charset.forName(charsetName)
Charset.defaultCharset()
ContentType contentType;contentType.getCharset()
- Smart code suggestions by Codota
}
public Map<String, List<EnumVO>> list() { List<EnumVO> httpMethodEnums = Arrays.stream(HttpMethodEnum.values()) .map(httpMethodEnum -> new EnumVO(null, httpMethodEnum.getName(), httpMethodEnum.getSupport())) .collect(Collectors.toList());
private Mono<Void> doHttpInvoke() { if (requestDTO.getHttpMethod().equals(HttpMethodEnum.GET.getName())) { String uri = buildRealURL(); if (StringUtils.isNoneBlank(requestDTO.getExtInfo())) { uri = uri + "?" + GSONUtils.getInstance().toGetParam(requestDTO.getExtInfo()); } return WEB_CLIENT.get().uri(uri) .headers(httpHeaders -> { httpHeaders.addAll(exchange.getRequest().getHeaders()); httpHeaders.remove(HttpHeaders.HOST); }) .exchange() .doOnError(e -> LogUtils.error(LOGGER, e::getMessage)) .timeout(Duration.ofMillis(timeout)) .flatMap(this::doNext); } else if (requestDTO.getHttpMethod().equals(HttpMethodEnum.POST.getName())) { return WEB_CLIENT.post().uri(buildRealURL()) .headers(httpHeaders -> { httpHeaders.addAll(exchange.getRequest().getHeaders()); httpHeaders.remove(HttpHeaders.HOST); }) .contentType(buildMediaType()) .body(BodyInserters.fromDataBuffers(exchange.getRequest().getBody())) .exchange() .doOnError(e -> LogUtils.error(LOGGER, e::getMessage)) .timeout(Duration.ofMillis(timeout)) .flatMap(this::doNext); } return Mono.empty(); }