I got this weird warning on WebClient.RequestHeadersSpec and wasn't sure what type I should be passing into the WebClient.RequestHeadersSpec<?> as part of the initialization of this requestSpec.
WebClient.RequestHeadersSpec requestSpec = webClientBuilder.build().get().uri(uri);
try {
return requestSpec
.header("Content-Type", HEADER_VALUE_CONTENT_TYPE)
.retrieve()
.bodyToMono(String.class)
.timeout(Duration.ofMillis(config.getTimeoutInMilliseconds()))
.block();
} catch (WebClientResponseException e) { // do something }
WebClient.RequestHeadersSpec is a raw type. References to generic type WebClient.RequestHeadersSpec should be parameterized Java(16777788)
However, this works fine with post(), so I am curious to know what's the main difference
WebClient.RequestBodySpec requestBodySpec = webClientBuilder.build().post().uri(uri);
note: the block() is needed, it is a sync call