 <p>I wrote a server side script that shows the output of headers from both examples and APIKEY was set identically in both cases. There were some differences in HTTP_ACCEPT / HTTP_ACCEPT_ENCODING and WWW::Mechanize adds some additional headers:</p> <pre><code>'downgrade-1.0' =&gt; '1' 'force-response-1.0' =&gt; '1' 'nokeepalive' =&gt; '1' </code></pre> <p>So I would suggest the problem is somewhere else. </p>