title: PHP cUrl : HTTP Error 400 while The Browser Displayed Correctly
body: <p><strong>URL:</strong></p>
  
  <p>You can see the url in <a href="http://pastebin.com/N8y1XYfL" rel="nofollow">Here</a> (I put the url in the pastebin because the url is quite long).</p>
  
  <p><strong>Curl &amp; Header :</strong></p>
  
  <pre><code>$header=array();            
  $header[]="Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
  $header[]="Accept-Encoding: gzip, deflate";
  $header[]="Accept-Language: en-US,en;q=0.5";
  $header[]="Connection: keep-alive";
  
  
  $ch = curl_init($url);
  curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
  curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7');
  curl_setopt($ch, CURLOPT_AUTOREFERER, 1);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  curl_exec($ch);
  </code></pre>
  
  <p><strong>Result:</strong> </p>
  
  <blockquote>
    <p>Error 400--Bad Request
    From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
    10.4.1 400 Bad Request</p>
  </blockquote>
  
  <p>The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications."</p>
  
  <p><strong>The Browser when go to the URL directly without curl:</strong></p>
  
  <p>Displayed Nicely.</p>