$ cat build.gradle
...
dependencies {
....
implementation 'com.google.code.gson:gson'
...
}
...
$ cat GsonTest.java
...
import com.google.gson.GsonBuilder;
...
String req = new GsonBuilder().create().toJson(obj);
...
Mono<String> result = webClient.mutate()
.build()
.post()
.uri(uri)
.header("Content-Type", "application/json")
.header("openapikey", openapikey())
.bodyValue(req)
.accept(MediaType.APPLICATION_JSON)
.retrieve()
.bodyToMono(String.class);