This question is an exact duplicate of:
I am trying to update a field value in a SharePoint document library through SharePoint REST API. I am successfully when I try using Fiddler. When I send a command through Java code, it gives 400 Bad Request. Appreciate any help.
Wireshark capture (Failure with Java Code):