Wie reiche ich eine Post-Anfrage mit einem leeren Körper mit einem Jersey 2-Client?Post leeren Körper mit Jersey 2 Client
final MyClass result = ClientBuilder.newClient()
.target("http://localhost:8080")
.path("path")
.queryParam("key", "value")
.request(APPLICATION_JSON)
.post(What to fill in here if the body should be left empty??, MyClass.class);
Update: dies funktioniert:
final MyClass result = ClientBuilder
.newBuilder().register(JacksonFeature).build()
.target("http://localhost:8080")
.path("path")
.queryParam("key", "value")
.request(APPLICATION_JSON)
.post(null, MyClass.class);
Ich bin spät zur Party, aber FWIW Ihr Update ist die Antwort auf mein besonderes Problem - speziell ich möchte nicht einen Content-Type-Header :) –