के साथ खाली निकाय पोस्ट करें मैं जर्सी 2 क्लाइंट के साथ खाली निकाय के साथ एक पोस्ट अनुरोध कैसे सबमिट करूं?जर्सी 2 क्लाइंट
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);
अद्यतन: इस काम करता है:
final MyClass result = ClientBuilder
.newBuilder().register(JacksonFeature).build()
.target("http://localhost:8080")
.path("path")
.queryParam("key", "value")
.request(APPLICATION_JSON)
.post(null, MyClass.class);
मैं पार्टी के लिए देर हो रही है, लेकिन FWIW अपने अद्यतन मेरी विशेष समस्या का जवाब है - विशेष रूप से मैं एक Content-Type हैडर :) –