HTTP POST Request, 400 bad request error

26.4k Views Asked by At

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?

1

There are 1 best solutions below

1
On

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.