java.io.IOException: Server returned HTTP response code: 400 for URL

hi,
i send this request in postman and get response as i need, but in java code i get this error repeatedly.

Hi,

What does the request do?

Mark

hi,
Update a row in table ‘Lock’ just one property “cennection_status”:false

hi
this is all my code, just one class of java.
i wrote this project in Intelij Idea.

myp.rar (9.25kB)

Per the support policy we do not review project code, however, if you can share the details of a specific REST request you make in Postman, we can help you with that. We would need to know the following:

    URL where you send the request Request body Request headers HTTP method (GET/POST/PUT/DELETE)
Regards, Mark

hi
please don’t worry and open my project file, because i created new project and i wrote just a put request on it, nothing else. i do not sent my main files, just one class is in that jar file and just one method for send request is in it, so you can find every detail you need in it. thank you.

You file you attached is broken:

http://support.backendless.com/public/attachments/655f3debb9e5a4e7432740ceb48ef1eb.jpg</img>

You said you have a problem with Postman, let’s focus on that instead.

655f3debb9e5a4e7432740ceb48ef1eb.jpg

ok, see this one

Main.zip (0.92kB)

myp.zip (10.19kB)

The code doesn’t quite make sense. You’re sending a PUT request (which is an object update), but there is no body in the request. See the docs here:

https://backendless.com/docs/rest/doc.html#dynanchor5

Hi,

your provided link does not tell me anything about BODY and how can i set BODY. but i heard your word about problem is in BODY, furthermore i tried to change it and it worked.

i changed a sample code for my purpose so does not work well, i change body from option 1 to option 2 and it worked well:

  1. requestParameters = “connection_status=false”;

  2. requestParameters = “{“connection_status”:false}”;

Thanks for your support.