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
Download (untitled) / with headers
text/plain 805b
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?
Download (untitled) / with headers
text/plain 1.1k
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?


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.