cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: POST problems

From: Mohun Biswas <m_biswas_at_mailinator.com>
Date: Wed, 10 Nov 2004 21:52:20 -0500

Andy Hobbs wrote:
> I am creating a buffer (postData) which contains a URI escaped set of
> parameters (encoded using curl_escape()) and then I try to add this to
> me request with the following call:
>
> code = curl_easy_setopt(handle, CURLOPT_POSTFIELDS, postData);
>
> this returns 0, (CURL_OK) so should have succeeded. however when I
> perform the request a GET is performed and none of my parameters are
> passed to the server.

Can't provide any help except to report a similar and possibly related
problem! I've noticed that when I tell libcurl to do a POST but don't
supply a body, it silently converts to a GET. Kind of an annoyance
though I can work around it ok. I'd love to know if this is a bug or a
requirement of RFC2616 though.

(You might wonder why someone would POST without a body ... in my case,
there usually is a body but I also pass a few parameters, and once in a
while the parameters are needed but there's no file to upload.)

MB
Received on 2004-11-11