Skip Menu |

This queue is for tickets about the libwww-perl CPAN distribution.

Report information
The Basics
Id: 65854
Status: rejected
Priority: 0/
Queue: libwww-perl

People
Owner: Nobody in particular
Requestors: edouard.henrion [...] crchum.qc.ca
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: LWP::UserAgent
Date: Thu, 17 Feb 2011 16:41:32 -0500
To: bug-libwww-perl [...] rt.cpan.org
From: Édouard Henrion <edouard.henrion [...] crchum.qc.ca>
Hi, Since I upgraded to perl 5.10, I cannot use the LWP::UserAgetn module : it always returns a 302 error (Not Allowed) when I try to "post", and a 401 (Unauthorized) when I try to "get" Here is an example of a code that works fine with perl 5.8 (returns me the content of the web page) and does not work with perl 5.10 (always reach the 'print $res->status_line, "\n";' instruction...) : # Create a user agent object use LWP::UserAgent; my $ua = LWP::UserAgent->new; $ua->agent("MyApp/0.1 "); # Create a request my $req = HTTP::Request->new(POST => 'http://search.cpan.org/search'); $req->content_type('application/x-www-form-urlencoded'); $req->content('query=libwww-perl&mode=dist'); # Pass request to the user agent and get a response back my $res = $ua->request($req); # Check the outcome of the response if ($res->is_success) { print $res->content; } else { print $res->status_line, "\n"; } Have you ever heard of such a behaviour ? Is it really related to the version of Perl ? What should I do to make it work ? Thanks a lot ! Édouard
Works fine for me with LWP 6.01 and Perl 5.12.1. Trace with abbreviated response body: POST /search HTTP/1.1 TE: deflate,gzip;q=0.3 Connection: TE, close Host: search.cpan.org User-Agent: MyApp/0.1 libwww-perl/6.01 Content-Type: application/x-www-form-urlencoded Content-Length: 27 query=libwww-perl&mode=dist --------------------------------- HTTP/1.1 200 OK Date: Tue, 15 Mar 2011 15:36:40 GMT Server: Apache/1.3.33 (Unix) Content-Length: 11598 Content-Type: text/html; charset=iso-8859-1 Connection: close <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html>…
Not reproducible.