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.plIn reply to Can't access {POST|PUT}DATA from CGI script by vendion
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |