hi
I'm trying to use the example here:
here is the code:
and here is the response:
what am I doing wrong? what is the meaning of the error response?
I'm trying to use the example here:
here is the code:
Code:
use LWP::UserAgent;
use LWP::Debug qw(+);
# Create a user agent object
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";
}
Code:
LWP::UserAgent::new: () LWP::UserAgent::request: () LWP::UserAgent::send_request: POST http://search.cpan.org/search LWP::UserAgent::request: Simple response: Not Implemented 501 Protocol scheme '' is not supported
Comment