vendion has asked for the wisdom of the Perl Monks concerning the following question:
I am working on a CGI script that the only form of input is by ether a POST or a PUT. The problem is no matter what I do in testing the result of CGI's param('POSTDATA') or param('PUTDATA') is always undefined. The way that I am accessing these variables are:
#!/usr/bin/perl use strict; use warnings; use CGI qw/ :standard -debug /; use CGI::Carp qw(fatalsToBrowser); print header; my $incoming = param('POSTDATA'); if ( ! defined $incoming ) { $incoming = param('PUTDATA'); } print $incoming;
The way I am testing this is using Curl to submit a XML file via a PUT to my CGI script, but when I run the script in offline mode I have the same issue. My curl command is as follows:
curl -T test.xml --trace output http://localhost/cgi-bin/api.pl
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Can't access {POST|PUT}DATA from CGI script
by chromatic (Archbishop) on Aug 16, 2011 at 00:40 UTC | |
|
Re: Can't access {POST|PUT}DATA from CGI script
by derby (Abbot) on Aug 16, 2011 at 11:40 UTC | |
by vendion (Scribe) on Aug 16, 2011 at 12:56 UTC | |
|
Re: Can't access {POST|PUT}DATA from CGI script
by Anonymous Monk on Aug 16, 2011 at 00:29 UTC |