good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re^3: Perl CGI return 400 Bad request response with JSON contentby cavac (Parson) |
on Apr 04, 2022 at 09:11 UTC ( [id://11142658]=note: print w/replies, xml ) | Need Help?? |
Let's look at the RFC for HTTP status code 400:
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.
perl -e 'use Crypt::Digest::SHA256 qw[sha256_hex]; print substr(sha256_hex("the Answer To Life, The Universe And Everything"), 6, 2), "\n";'
In Section
Seekers of Perl Wisdom
|
|