I am having a problem POSTing or GETting data. I am using the LWP::UserAgent
module. Here is the code that I am executing and the error that I get.

use URI::URL;
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Response;

$ua = new LWP::UserAgent;
$ua->agent("Mozilla/2.0");
$req = new HTTP::Request 'POST', 'http://some.fix.ip/cgi-bin/testparam.pl';
$req->content_type('application/x-www-form-urlencoded');
$curl = url('http:');
$curl->query_form(action => 'add', login => 'a10');
$req->content($curl->equery);
$res = $ua->request($req);

if ($res->is_success) {
   print $res->content;
} else {
   print $res->as_string();
}
exit(0);


This is the error that I get
500 (Internal Server Error) Modification of a read-only value attempted ...

When I call the same script (testparam.pl) from a browser, it works fine.
What could be wrong here ??? Urgent. Please Help .

Thanks!
Abhin Parkhi

Reply via email to