Created
November 18, 2018 14:25
-
-
Save codingtim/c5b07a679d146db47aa825f184945c8e to your computer and use it in GitHub Desktop.
Revisions
-
codingtim created this gist
Nov 18, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ class ApiCaller { private WebClient webClient; ApiCaller(WebClient webClient) { this.webClient = webClient; } Mono<SimpleResponseDto> callApi() { return webClient.put() .uri("/api/resource") .contentType(MediaType.APPLICATION_JSON) .header("Authorization", "customAuth") .syncBody(new SimpleRequestDto()) .retrieve() .bodyToMono(SimpleResponseDto.class); } }