title: Why is cURL hanging after sending and receiving an HTTP 100 Continue code, not continuing with the body?
body: <p>I am currently putting together some data and making a POST request to my local web server (Apache 2.4.27).</p>
  
  <p>Here's how I'm putting together the request:</p>
  
     <pre class="lang-php prettyprint-override"><code>public function sendPost($url, array $data) {
      $ch = curl_init($url);
      $httpCodes = parse_ini_file(CONF::HTTP_CODES_INI);
      curl_setopt($ch, CURLOPT_CONNECTTIMEOUT , 30);
      curl_setopt($ch, CURLOPT_TIMEOUT , 30);
      curl_setopt($ch, CURLOPT_POST, true);
      curl_setopt($ch, CURLOPT_POSTFIELDS, ['data' =&gt; json_encode($data)]);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
      curl_setopt($ch, CURLOPT_VERBOSE, true);
      //Ignore SSL issues, testing on a dev box
      curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
      $result = curl_exec($ch);
      $curlInfo = curl_getinfo($ch);
      $httpCode = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
      $curlInfo["http_code"] = $httpCode . ': ' . $httpCodes[$httpCode];
      if ($result === false || $httpCode &gt; 299) {
          $result = json_encode($curlInfo);
      }
      curl_close($ch);
      return $result;
  }
  </code></pre>
  
  <p>This is the conversation I see from cURL</p>
  
  <pre><code>*   Trying 127.0.0.1...
  * TCP_NODELAY set
  * Connected to my.local.server.com (127.0.0.1) port 80 (#0)
  &gt; POST /path/script.php?action=receive HTTP/1.1
  Host: my.local.server.com
  Accept: */*
  Content-Length: 2645588
  Expect: 100-continue
  Content-Type: multipart/form-data; boundary=------------------------051580b0f5143de8
  
  &lt; HTTP/1.1 100 Continue
  * Operation timed out after 30000 milliseconds with 0 bytes received
  * Curl_http_done: called premature == 1
  * Closing connection 0
  </code></pre>
  
  <p>However, while debugging the script on the server, I do actually get the data and the request seems to go through all of the way.  From my understanding the <code>HTTP 100 Continue</code> status code, cURL should only send the header first, see the <code>continue</code> response, and then send the data.</p>
  
  <p>You can see above that the client receives the <code>HTTP/1.1 100 Continue</code>, but then it times out.</p>
  
  <p>I've tried setting the timeout time to 5 minutes, and it still just hangs until timeout.</p>
  
  <p>Any ideas?</p>
  
  <p>Edit: I'ved tried to use  </p>
  
  <pre><code>curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
  </code></pre>
  
  <p>to try and force the <code>continue</code> expectation to not be set.  The response is the same, just without the <code>Expect: ...</code> part.</p>