Good idea! I used Ethereal, and here is the result. Win32::Internet sent the following request:
GET /tile.ashx?T=1&S=13&X=321&Y=3329&Z=10 HTTP/1.1\r\n Accept: , , , , , , M\360\017\204-\002\r\n User_Agent: Perl-Win32::Internet/0.081\r\n Host: terraserver-usa.com\r\n \r\n
And Opera sent this:
GET /tile.ashx?T=1&S=13&X=321&Y=3329&Z=10 HTTP/1.1\r\n User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows 98) Opera 7.23 +[en]\r\n Host: terraserver-usa.com\r\n Accept: text/html, application/xml;q=0.9, application/xhtml+xml;q=0.9, + image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1\r\n Accept-Language: en\r\n Accept-Charset: windows-1252, utf-8, utf-16, iso-8859-1;q=0.6, *;q=0.1 +\r\n Accept-Encoding: deflate, gzip, x-gzip, identity, *;q=0\r\n Cache-Control: no-cache\r\n Connection: Keep-Alive, TE\r\n TE: deflate, gzip, chunked, identity, trailers\r\n \r\n
This is an obvious answer to my first question. I guess I need to expand that question to, "What part of this makes the difference?" And, again, my second question, "How do I make Win32::Internet do that?

Update: And to answer that I tried specifying the MIME types I would accept, as follows:

sub Get { my ($url, $req) = @_; my ($http, $request); my $result = $Internet->HTTP($http, $url, 'anonymous', 'none', ); if ($result) { my ($status, $header, $content) = $http->Request("/$req", 'GET +', 'HTTP/1.1', 'none', "image/gif\0image/jpeg"); $http->Close; return ($header, $content) } else { return undef } }
And that, apparently, was all the server needed. The script now works as well as it did before. Thanks to NetWallah for pointing me to Ethereal!

In reply to Re: Re: Win32::Internet and TerraServer by Dr. Mu
in thread Win32::Internet and TerraServer by Dr. Mu

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.