in reply to Re: how to troubleshoot a http::request 404 problem
in thread how to troubleshoot a http::request 404 problem

The user agent string clearly wasn't the problem here as YourMother shows. However, claiming to be different browsers is not "nutty".

I've done maybe 1/2 dozen LWP programs and I've found that fiddling with the agent string by claiming to be something really stupid, like Netscape 4.76 can result in getting a returned page that is significantly easier to deal with than whatever the default is. I think that even in one case I was able to get a page without java script in it by just claiming to be "stupid". I'm sure the web developers had to code that as a special case, but evidently they did.

Anyway some experimentation with claiming to be different browser types can sometimes produce interesting results. Of course this is completely site dependent. If you have the wrong level of browser for a site, usually you get a message saying that rather than a 404 (i.e. it will say something rather than remaining silent). Here's how to claim to be "stupid":

$ua->agent("Mozilla/4.76 [en] (Windows NT 5.0; U)");

Replies are listed 'Best First'.
Re^3: how to troubleshoot a http::request 404 problem
by roboticus (Chancellor) on Feb 20, 2011 at 07:48 UTC

    Marshall:

    Heh, heh! I didn't mean to imply that using a different agent string is a nutty idea. I've simply seen that suggestion in concert with this sort of request before. I gather that many web apps offer useless results if they don't see an agent string they recognize. (Such as "Oh, it's not Internet Explorer? Then instead of giving the browser the intended data, I'll send them to the Firefox page which doesn't do anything yet.")

    The nutty part is me offering a suggestion on code relying on modules I'm unfamiliar with. I intended the comment as a disclaimer.

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.