in reply to Re: POSTing QueryString data using LWP::UserAgent
in thread POSTing QueryString data using LWP::UserAgent
I keep getting an error message saying that the file is empty or invalid (I've confirmed that the file is not empty and it is in the same folder as the Perl file which is executing ) Is there something missing in the POST call ? my second question is whether instead of POSTing the XML data in a file, is it possible to post the XML data contained in a scalar variable ?use HTTP::Request::Common; my $filetoopen = 'tp1.xml'; #XML file name my $ua = new LWP::UserAgent; my $res = $ua->request(GET 'http://2.2.2.2/receive.asp'); if ($res->is_success) { { no strict 'subs'; $res = $ua->request(POST 'http://2.2.2.2/receive.asp', Content +_Type => 'form-data', Content => [ username => test, password => test, init => [$filetoopen,$filetoopen], ]); } ...rest of the code...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: POSTing QueryString data using LWP::UserAgent
by screamingeagle (Curate) on Jan 10, 2002 at 13:23 UTC |