However, I do not know how to test for errors. My goal is to find something in the HTTP response that will tell me if the request was successful or not. $response->as_string gives me this error message that I do not understand at all:
500 (Internal Server Error) unexpected EOF before status line seen Client-Date: Thu, 14 Nov 2002 16:10:08 GMT
HOWEVER, the script is successfully called, despite the 500 error message, which makes this case even more puzzling.
Here is my code:
Thanks, you guys have been great in the past! Robert# HTTPIZE! foreach $elem ( keys %tform ) { $tform{$elem} = &cgi'httpize($tform{$elem}); } $qs = "Firstname=$tform{firstname}%20$tform{lastname}&Company= +$tform{company}&WorkStreetAddress=$tform{addr1}&WorkCity=$tform{city} +&WorkProvince=$tform{state}&WorkCountry=$tform{country}&WorkZipCode=$ +tform{zip}&WorkPhone=$tform{phone}&txtAddEmail=$tform{email}&signUpGS +N=T"; my $ua = new LWP::UserAgent; $ua->credentials('www.SENDER.com','outer','proactive','gr8ap3' +); $header = new HTTP::Headers; $header->header(MIME_Version => '1.0', User_Agent => 'Viaduct Proactive/2.0', From => 'proactive\@viaduct.com'); $page = 'http://www.RECEIVER.com/nti/nti.pl?'; $request = new HTTP::Request 'POST',$page,$header,$qs; $response = $ua->request ($request); $action = $response->as_string; open (TEST, ">TEST.txt") || die "ARGH!\n\n"; # THIS LINE GENERATES THE 500 ERROR! print TEST "$action\n"; # AS A RESULT, I FAIL! BOO HOO! if ($response->is_redirect) { print TEST "SUCCESS\n"; } else { print TEST "FAILED\n"; } close (TEST);
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |