in reply to Best practice for letting my CGI scripts access another password protected CGI script?

I found the answer here: 386070. The key was to use
my $headers = HTTP::Headers->new(); $headers->authorization_basic('user', 'pass'); my $request = new HTTP::Request(GET => $url, $headers);
instead of
$ua->credentials('www.domain.com:80', '', 'user', 'pass');
  • Comment on Re: Best practice for letting my CGI scripts access another password protected CGI script?
  • Select or Download Code

Replies are listed 'Best First'.
Re^2: Best practice for letting my CGI scripts access another password protected CGI script?
by Anonymous Monk on Oct 30, 2013 at 01:02 UTC

    Well, now I see this post :)

    www.domain.com and domain.com and domain.com:365 are all different ... so figure out which one you need ... easier than ...Headers->new

    LWP uses host_port for basic-auth

    $ perl -MLWP -le " print URI->new( $_ )->host_port for qw{ http://www +.example.com http://example.com:365 }; " www.example.com:80 example.com:365