Just copy this code from perl cook book 2nd ed pp. 796
it returns:
400 URL must be absolute.
What’s wrong with this code?
#!"c:\strawberry\perl\bin\perl.exe" -w
use 5.006;
use strict;
use LWP::Simple;
use LWP::UserAgent;
my $ua = LWP::UserAgent->new();
my $resp = $ua->post("www.amazon.com/exec/obidos/search-handle-form",
{ "url" => "index-books",
"field-keywords" => "perl"}
);
my $content = $resp->content;
print $content, "\n";
You forgot the
http://on the front of the URLWell, presumably
http://, it might behttps://,ftp://, etc, etc.