curl-library
Re: Issue with content-type for no content body..
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.
Thanks
Sukanya
On Tue, Jan 17, 2012 at 1:15 PM, Dan Fandrich <dan_at_coneharvesters.com>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: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-01-17