Subject: | cgi_error() returns "400 No data received via method: GET" on GET with no parameters |
Trying to figure out flow of control to catch errors upon file uploads, I tried this:
my $q = new CGI::Simple;
my $error = $q->cgi_error;
if( defined $error ) {
... complain ...
exit 0;
}
# Display form if first time entered ...
unless( $q->param ) {
... display form ...
} else {
... process form ...
}
However I consistently received an error displayed as
400 No data received via method: GET, type: No CONTENT_TYPE received
when accessing the program using a URL like
http://localhost/cgi-bin/test/upload2
I didn't receive an error if added any query string, like
http://localhost/cgi-bin/test/upload2?boo
Neither URL will produce an error with CGI.pm when using the similar code. Why should a GET request require a query string?