in reply to Re^2: Perl CGI return 400 Bad request response with JSON content
in thread Perl CGI return 400 Bad request response with JSON content
Let's look at the RFC for HTTP status code 400:
6.5.1. 400 Bad Request The 400 (Bad Request) status code indicates that the server cannot +or will not process the request due to something that is perceived to +be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
Basically, "400" code tells the server that you did not properly understood the request or refused to parse it. Depending on your webserver software, it may choose to interpret that to mean "i could not make sense of this, send the default error page".
Are you SURE this is actually the error code you want to use? It basically means "i did not understand your request at all".
Unless the client sent complete garbage, in all likelyhood there is a HTTP status code from the 4xx group that will fit better. Take a look.
|
|---|