Backendless Support
 
Answered

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.

Leave a Comment

Comments (9)

photo
1

Hi,

What does the request do?

Mark

photo
1

hi,

Update a row in table 'Lock' just one property "cennection_status":false

photo
1

hi

this is all my code, just one class of java.

i wrote this project in Intelij Idea.

Files: myp.rar
photo
1

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:

  1. URL where you send the request
  2. Request body
  3. Request headers
  4. HTTP method (GET/POST/PUT/DELETE)

Regards,

Mark

photo
1

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.

photo
1

You file you attached is broken:

655f3debb9e5a4e7432740ceb48ef1eb

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

photo
1

ok, see this one

photo
1

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

photo
1

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.