in reply to Help with LWP::UserAgent server error 500

Now, when I run it I get at server error 500. Yet if I browse to the URL with Firefox I have no problem accessing the file??

What am I doing wrong?

You're talking to a broken server. If it works with Firefox, pretend to be firefox (send similar user agent and whatever else headers firefox sends). If that doesn't work, contact the webmaster.

MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
** The third rule of perl club is a statement of fact: pod is sexy.

  • Comment on Re: Help with LWP::UserAgent server error 500

Replies are listed 'Best First'.
Re^2: Help with LWP::UserAgent server error 500
by inman (Curate) on Jun 29, 2005 at 16:44 UTC
    This isn't strictly true. LWP returns a status code of 500 itself to indicate that something didn't happen as planned on the client side. I have seen this issue most frequently when trying to access a site without setting the required proxy envrironment variable that I need in my company.
    C:\>get http://perlmonks.com C:\>500 Can't connect to www.perlmonks.com:80 (connect: Unknown error)

    If the OP had missed a required proxy setting step then this would explain why they could access the file using a browser (presumably set up to use a proxy) but not the script.

    As a general point, it may be useful to use LWP::Debug qw(+); to trace the progress of an LWP transaction.