Re: Weird cURL operation timed out error with HTTP POST

Daniel Stenberg <[email protected]> Tue, 19 Feb 2013 19:54:56 +0100 (CET)
Newsgroups gmane.comp.web.curl.php
Message-ID <[email protected]>
On Tue, 19 Feb 2013, Phil wrote:

> cURL-Version: 7.18.2

One word: old.

> I'm getting a weird timeout when trying to use cURL to post to a server. The 
> http_code of curl_getinfo() is 0. "Operation timed out after 5000 
> milliseconds with 0 bytes received"
>
> It does not depend on whether using HTTP or HTTPS.
> The weird thing is: when omitting the content-length header, it works fine!

It happens when you provide the wrong length. If you compare with that is sent 
when you let libcurl do its business on its own, you'll find out that the sent 
header is different.

Setting Content-Length yourself in a PHP program using PHP/CURL is almost 
never the right way. Independently of libcurl version.

-- 

  / daniel.haxx.se
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php