ClientResponse response = webClient.get()
.uri("http://example.com/api")
.exchange()
.block();
ResponseEntity<byte[]> entity = ResponseEntity
.status(response.statusCode())
.headers(headers -> {
headers.putAll(response.headers().asHttpHeaders());
headers.remove(HttpHeaders.TRANSFER_ENCODING); // 削除
})
.body(response.bodyToMono(byte[].class).block());
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme