Re: post request with content length 0

[email protected] (Philippe Bruhat (BooK))
Newsgroups gmane.comp.lang.perl.modules.lwp
Message-ID <[email protected]>
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))
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.