HTTP POST Request, 400 bad request error

user2324679 picture user2324679 · Aug 26, 2013 · Viewed 25.3k times · Source

I am having a problem with HTTP requests. I keep getting a 400 error.

The service I'm trying to access is expecting a JSON body with the following format:

{
    "items":[{
        "id":0,
        "modifiers":[],
        "note":"",
        "quantity":0
    }],
    "type":0
}

Where 0 can be any number really. However, the request that my application is sending is formatted like this.

{
    "items":[{
        "id":0,
        "note":"",
        "modifiers":[],
        "quantity":0
    }],
    "type":0
}

Could this be the cause of the 400 HTTP Request error code that I keep getting?

Answer

Saurav picture Saurav · Aug 26, 2013

This is not the error reason. Order of the json key:value doesn't matter. You could check this link to find out error reason:

http://www.checkupdown.com/status/E400.html

hope this will help you.