Dr. Mu has asked for the wisdom of the Perl Monks concerning the following question:
Typical values for $url and $req would be:sub StartInternet { $Internet = Win32::Internet->new } sub Get { my ($url, $req) = @_; my $http; my $result = $Internet->HTTP($http, $url, 'anonymous', ''); if ($result) { my ($status, $header, $content) = $http->Request("/$req"); $http->Close; return ($header, $content) } else { return undef } }
and the script worked just fine.$url = 'terraserver.microsoft.com'; $req = 'tile/tile.asp?T=1&S=13&X=321&Y=3329&Z=10'
Now, however, Microsoft has changed the url to terraserver-usa.com and seems to be herding everyone into using their .NET RPCs. Nonetheless, the website is still able to retrieve individual tiles using addresses like:
Yet, when reconfigured for the new addresses, my script no longer works. I get a "400 Bad request" each time. So my question is, what is my browser (Opera 6 on Windows) sending to the server that Win32::Internet isn't, or vice-versa, and how can I turn a bad request into a good one? (I'd prefer not to use SOAP. It seems like overkill just for accessing static content.)terraserver-usa.com/tile.ashx?T=1&S=13&X=321&Y=3329&Z=10
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32::Internet and TerraServer
by NetWallah (Canon) on Feb 17, 2004 at 19:49 UTC | |
by Dr. Mu (Hermit) on Feb 17, 2004 at 21:25 UTC |