title: CURL Post request with get parameter, Expect header
body: <p>I want to make an login with CURL on a site, looking like </p>
  
  <blockquote>
    <p><a href="http://www.example.com/login.php?return=" rel="nofollow">http://www.example.com/login.php?return=</a></p>
  </blockquote>
  
  <p>The parameters are going to send with Post</p>
  
  <blockquote>
    <p>curl_setopt($ch, CURLOPT_POST, TRUE);<br/>$data = array ("params" => "param"
           );<br/>
          curl_setopt($ch, CURLOPT_POSTFIELDS, $data);</p>
  </blockquote>
  
  <p>CURL is setting an </p>
  
  <blockquote>
    <p>Expect: 100-continue Header</p>
  </blockquote>
  
  <p>and I will get an</p>
  
  <blockquote>
    <p>417 - Expectation Failed</p>
  </blockquote>
  
  <p>as response.</p>
  
  <p>So it isn't working. When i try to remove the Expect Header</p>
  
  <blockquote>
    <p>curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect: '));</p>
  </blockquote>
  
  <p>CURL is sending a GET request and not a POST request. What am I doing wrong? </p>
  
  <pre><code>    $ch = curl_init();
  
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
      curl_setopt($ch, CURLOPT_USERAGENT, $this-&gt;useragent);
  
      curl_setopt($ch, CURLOPT_URL, "http://www.example.com/login.php?return=");
  
      curl_setopt($ch, CURLOPT_REFERER, "http://www.example.com/login.php");
  
      curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
      curl_setopt($ch, CURLOPT_POST, TRUE);
  
      #curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect: '));
  
      $data = array (
          "param1" =&gt; $username,
          "param2" =&gt; $password
       );
      curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
  
      $response = curl_exec ($ch); 
      curl_close($this-&gt;ch);
  </code></pre>