0

I am using Apache HTTPClient version 4.3.5. I am trying to create a HTTP PATCH request.

HttpPatch request = new HttpPatch(ServerURL);
StringEntity params = new StringEntity(requestBody, ContentType.APPLICATION_JSON);
request.setEntity(params);
client.execute(request);

On checking the actual request received, it didn't have a body associated with it. Similar code is working fine for HTTP POST requests.

Vel Ganesh
  • 537
  • 3
  • 12
  • 32
  • 1
    You can see exactly what kind of HTTP messages HttpClient generates by turning on wire logging as described here http://hc.apache.org/httpcomponents-client-4.3.x/logging.html. I am quite sure HC can handle PATCH requests with content entity correctly. – ok2c Dec 30 '14 at 09:46
  • Yes, you are correct. It was my mistake in some other part of the code. Once I fixed it, things started to work as expected. – Vel Ganesh Dec 30 '14 at 10:06

0 Answers0