title: Difference between cURL and web browser?
body: <p>I am trying to retrieve a web page from the following url:</p>
  
  <p><a href="http://www.medicare.gov/find-a-doctor/provider-results.aspx?searchtype=OHP&amp;specgrpids=922&amp;loc=43615&amp;pref=No&amp;gender=Unknown&amp;dist=25&amp;lat=41.65603&amp;lng=-83.66676" rel="nofollow">http://www.medicare.gov/find-a-doctor/provider-results.aspx?searchtype=OHP&amp;specgrpids=922&amp;loc=43615&amp;pref=No&amp;gender=Unknown&amp;dist=25&amp;lat=41.65603&amp;lng=-83.66676</a></p>
  
  <p>It works when I paste it into a browser, but when I run it through cURL, I receive a page with the following error: <b>"One or more query string parameters of requested url are invalid or has unexpected value, please correct and retry."</b></p>
  
  <p>It doesn't seem to make a difference if I provide a different userAgent or referrer. There is a redirect, so I use CURLOPT_FOLLOWLOCATION.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>$ch = curl_init($page);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 5.1; rv:12.0) Gecko/20100101 Firefox/12.0');
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  
  $html = curl_exec($ch);
  curl_close($ch);
  echo $html;
  </code></pre>
  
  <p>Any thoughts on why a request like this will work in the browser and not with cURL?</p>