Hi,
I am trying to POST some form data that is in a protected area using LWP::UserAgent but $res is always blank. I know the userID and password are correct. Can anyone give me an idea as to why this is not working?
[tt]use LWP::UserAgent;
$ua = new LWP::UserAgent;
$ua->agent("AgentName/0.1 " . $ua->agent);
$userID = "data to post"
my $req = new HTTP::Request POST => '$req->content_type('application/x-$req->content('userid=$userid&submit=History');
$req->authorization_basic('userid', 'password');
# Pass request to the user agent and get a response back
my $res = $ua->request($req);
# Check the outcome of the response
if ($res->is_success) {
print $res->content;#<--- this contains the output from the page[/tt]
Thanks [sig]<p>fortytwo<br><a href=mailto:will@hellacool.co.uk>will@hellacool.co.uk</a><br><a href= test site</a><br> [/sig]
I am trying to POST some form data that is in a protected area using LWP::UserAgent but $res is always blank. I know the userID and password are correct. Can anyone give me an idea as to why this is not working?
[tt]use LWP::UserAgent;
$ua = new LWP::UserAgent;
$ua->agent("AgentName/0.1 " . $ua->agent);
$userID = "data to post"
my $req = new HTTP::Request POST => '$req->content_type('application/x-$req->content('userid=$userid&submit=History');
$req->authorization_basic('userid', 'password');
# Pass request to the user agent and get a response back
my $res = $ua->request($req);
# Check the outcome of the response
if ($res->is_success) {
print $res->content;#<--- this contains the output from the page[/tt]
Thanks [sig]<p>fortytwo<br><a href=mailto:will@hellacool.co.uk>will@hellacool.co.uk</a><br><a href= test site</a><br> [/sig]