cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Documentation on how to do a zero-byte POST is misleading

From: Emil Romanus <sdac.bithack_at_gmail.com>
Date: Tue, 20 Nov 2007 20:50:23 +0000

2007/11/20, McGarvey, Kevin <kmcGarvey_at_verisign.com>:
> but this doesn't:
>
> curl_rc = curl_easy_setopt(clntPtr_, CURLOPT_POSTFIELDSIZE, 0);
> curl_rc = curl_easy_setopt(clntPtr_, CURLOPT_POSTFIELDS, NULL);
>

Very strange. Because as I remember it, that was *the* solution for a
problem I had before the documentation was updated with this info. It
solved my problem when doing a no-content post. My case involved doing
multiple POST and GET requests in a row using the same handle, then
finally a no-content POST request.

What libcurl version do you have?

>
> Setting CURLOPT_POSTFIELDS to NULL causes the subsequent post request to
> block
>

That's the exact issue I had, we solved it here on the mailing list
and Daniel added the notice in the documentation. The solution, which
worked for me, was to set CURLOPT_POSTFIELDSIZE to 0.

Regards,
Emil Romanus
Received on 2007-11-20