Le mercredi 25 avril 2007 à 10:54, Ulrich Wisser écrivait:
> Hi,
>
> I have a small script trying to login into a website. Of course they use
> forms and cookies for that. Unfortunately does my code not work. If
> tried many approaches but without success. One thing I recognized is,
> that $ua->post() sends "Content-length: 0" header with the request.
> Which I find quite strange. Please see my script and sample output below.
>
> What do I do wrong?
Your call to post() looks wrong:
> my $res = $ua->post('http://search.cpan.org/search', (perl test2
> query=>'libwww-perl',mode=>'dist'));
The manual says:
$ua->post( $url, \%form )
$ua->post( $url, \@form )
$ua->post( $url, \%form, $field_name => $value, ... )
--
Philippe "BooK" Bruhat
There is no greater magic than knowing exactly who and what you are.
(Moral from Groo #2 (Image))
|