cURL / Mailing Lists / curl-library / Single Mail


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

From: Dan Fandrich <>
Date: Mon, 16 Jan 2012 23:45:44 -0800

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:
Received on 2012-01-17