vxp has asked for the wisdom of the Perl Monks concerning the following question:
this has got to be something simple/stupid :)
I'm trying to authenticate to a website and grab a file and I'm failing to see what I'm doing wrong here:
#!/usr/bin/perl use strict; use LWP; my $browser = LWP::UserAgent->new( ); $browser->credentials("http://hostname.domain.com:80/OPDATA/Config/Vie +w.pcgi?DEVICE=WLC&JOB_TYPE=download&TITLE=1&JOB_STATUS=any", "EMAN Pr +otected Resource", "myusername", "mypassword"); my $response = $browser->get("http://hostname.domain.com/OPDATA/Config +/View.pcgi?DEVICE=WLC&JOB_TYPE=download&TITLE=1&JOB_STATUS=any"); print $response->content;
The thing of it is, I *KNOW* that my realm/username/pass is correct (I can auth just fine with wget, or a regular browser for instance).. but for some reason, the above code fails to authenticate. any idea what I'm doing wrong here?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: quick LWP question
by davorg (Chancellor) on Jun 23, 2009 at 16:01 UTC | |
by vxp (Pilgrim) on Jun 23, 2009 at 16:09 UTC | |
by ikegami (Patriarch) on Jun 23, 2009 at 16:28 UTC | |
|
Re: quick LWP question
by Mutant (Priest) on Jun 23, 2009 at 15:58 UTC | |
|
Re: quick LWP question
by imrags (Monk) on Jun 24, 2009 at 10:41 UTC |