|Perl Monk, Perl Meditation|
Different answers for script and browser (LWP)by Sly_G (Novice)
|on Jun 18, 2013 at 18:43 UTC||Need Help??|
Sly_G has asked for the
wisdom of the Perl Monks concerning the following question:
Site that I'm parsing with perl script recently moved to human-readable urls. I'm trying to get redirects from "id" requests to current addresses. For example, when I'm going to "http://www.giftman.ru/show.php?id=294" in browser, site server redirects it to "http://www.giftman.ru/catalog/amulets/"
But when I'm trying to get this moved location in my script, I don't get 301 answer, it returns "200 OK" for some reason.
I used http sniffer to see what's going on with browser, and there's nothing special, really:
By accident I stumbled on this: if I use $ua->get("http://www.giftman.ru/show.php?id=$ren 0"), i.e. space and some symbols after URL string, I'm getting completely different response, and there it is, "301 moved" and new location.
I can't understand what's happening.