cURL / Mailing Lists / curl-library / Single Mail


Re: Issue with content-type for no content body..

From: sukanya c <>
Date: Tue, 17 Jan 2012 15:19:35 +0530

Thanks Dan for your timley reply. It worked as per your suggestion.

But with the previous mentioned scenario, I am stuck up at other place. For
my request(with no content), server responds with some response, but
libcurl is not passing the response to my application. I captured TCP
packets and it shows the response received from the server, but libcurl is
not posting to application.

On Tue, Jan 17, 2012 at 1:15 PM, Dan Fandrich <>wrote:

> On Tue, Jan 17, 2012 at 11:39:34AM +0530, sukanya c wrote:
> > Exchange server expects no "Content-Type & Content-Length" header fields
> > if ther is no content body.
> > Hence, I cannot set the content-type to wbxml, to avoid libcurl adding
> the
> > default header.
> >
> > Now my query is "Why Libcurl adds the default Content-type header field,
> > eventhough there is no request body ".
> Are you doing a POST? If so, then, as documented, the default Content-Type
> for a POST is application/x-www-form-urlencoded. If you want no
> Content-Type
> header field at all, then set an empty one using CURLOPT_HTTPHEADER.
> >>> Dan
> -------------------------------------------------------------------
> List admin:
> Etiquette:

List admin:
Received on 2012-01-17