"400 (Bad Request) URL must be absolute"
The URL I put in the browser is: http://192.168.1.2/cgi-bin/testLWP.cgi
testLWP.cgi
-----------------------------
#!c:/Program Files/Perl/bin/perl
use strict;
# Create a user agent object
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
$ua->agent("MyApp/0.1 ");
my $document = '192.169.1.1//status.htm';
my $req = HTTP::Request->new(GET => $document);
$req->header('Accept' => 'text/html');
$req->authorization_basic('blah', 'blah');
print "Content-type: text/html\n\n";
print $ua->request($req)->as_string;
------------------------------------------------
Anyone have any ideas?
Thanks,
- Wes
--
PLEASE NOTE: comp.infosystems.www.authoring.cgi is a
SELF-MODERATED newsgroup. aa.net and boutell.com are
NOT the originators of the articles and are NOT responsible
for their content.
HOW TO POST to comp.infosystems.www.authoring.cgi:
http://www.thinkspot.net/ciwac/howtopost.html
> I am getting the following error reported in my browser when I try to run
> the script shown below. It sounds more like an Apache problem, but my other
> scripts work just fine.
> "400 (Bad Request) URL must be absolute"
> my $document = '192.169.1.1//status.htm';
>
> my $req = HTTP::Request->new(GET => $document);
you need an absolute URL there.
--
brian d foy <com...@panix.com> - Perl services for hire
CGI Meta FAQ - http://www.perl.org/CGI_MetaFAQ.html
Troubleshooting Perl CGI scripts - http://www.perl.org/troubleshooting_CGI.html
Thanks to Randal Schwartz for giving me a hand via e-mail as well.
- Wes
"brian d foy" <com...@panix.com> wrote in message
news:170520021127429944%com...@panix.com...