Skip Menu |

This queue is for tickets about the CGI-Simple CPAN distribution.

Report information
The Basics
Id: 8539
Status: resolved
Priority: 0/
Queue: CGI-Simple

People
Owner: Nobody in particular
Requestors: tshinnic [...] io.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.075
Fixed in: (no value)



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?
I liked this behaviour, but as it is different from CGI it has been removed. I would use logic like this myself: if ( $q->param('submit') ) { if ( $q->cgi_error ) { barf() } else { process() } } else { show_form() } exit 0; [guest - Sun Nov 21 06:19:41 2004]: Show quoted text
> 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?