cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Disabling headers selectively

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Tue, 17 Oct 2006 21:55:13 -0700

On Tue, Oct 17, 2006 at 09:34:10PM -0700, Farhad Tarapore wrote:
> I am using libCurl in an application. The server to which I am sending the
> requests is an HTTP1.1 server. The expect100() function in http.c sends the
> "Expect:100-continue" header in its requests. Due to this the server returns
> something (I don't know what) and Curl gives CURLE_GOT_NOTHING (52).
> As soon as I disable the sending of the Expect header, things work fine.
> I have read in the page for curl_set_opt() that I should "use
> CURLOPT_HTTPHEADER to disable it as usual", but I don't see anything very usual
> about it since I only want to disable the Expect:100-continue header and not
> the rest of the headers that are present in the POST request.

So, did you read the man page to find out how to "usually" use
CURLOPT_HTTPHEADER? It's quite explicit, giving a detailed description of
the data structure to pass in, the values to use to disable headers, etc.

> So please provide some example of how this can be done. For the time-being to

There are examples on the curl web site, in the source code tar ball, on
this mailing list, and elsewhere.

> make things work, I have had to comment out sending of the Expect header
> completely. Also tell me how this impacts requests depending on various server
> behaviours.

curl is smart enough to do the right thing when you disable the Expect: header
in this way. Another way to disable this particular header is to disable
HTTP 1.1 mode, using CURLOPT_HTTP_VERSION.

> Thank you and best regards,

Your welcome.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2006-10-18