LWP::Simple doesn't support the POST method. You'll need to use LWP::UserAgent and HTTP::Request as described in lwpcook.
Another alternative might be to look at WWW::Mechanize.
--
< http://www.dave.org.uk>
"The first rule of Perl club is you do not talk about
Perl club." -- Chip Salzenberg
| [reply] |
LWP::Simple doesn't support the POST method.
Well, it sorta does, with a couple of extra steps:
use LWP::Simple qw($ua);
my $content = $ua->post("http://www.example.com",
[first_name => 'Randal', last_name => 'Schwartz'])->content;
Of course, all you're getting here is a LWP::UserAgent created for you, and the right modules brought in with one use line.
| [reply] [d/l] |
thanx, it worked with LWP::UserAgent, but now I have another problem with it, sometimes I get this response:
HTTP/1.1 302 Found
Connection: close
Date: Tue, 10 Aug 2004 18:27:57 GMT
Via: 1.1 netcache1 (NetCache NetApp/5.5R5D11)
Location: index.php
Server: Apache
Content-Type: text/html
Client-Date: Wed, 11 Aug 2004 21:40:47 GMT
Client-Peer: 64.191.74.245:80
Client-Response-Num: 1
Client-Transfer-Encoding: chunked
X-Powered-By: PHP/4.3.5
and sometimes it works ok...
what can be the problem? | [reply] |