cURL / Mailing Lists / curl-and-php / Single Mail


Re: How do I POST with a different Content-Type via php?

From: Daniel Stenberg <>
Date: Thu, 9 Aug 2007 09:28:54 +0200 (CEST)

On Thu, 9 Aug 2007, Richard Lynch wrote:

> $headers = array('User-Agent: myagent', 'Host:',
> 'Content-type: text/xml', 'Content-length: 250');

> curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);

I strongly advice you to not set Content-length yourself but instead let
libcurl do that itself since you confuse it greatly if you set the wrong size.

  Commercial curl and libcurl Technical Support:
Received on 2007-08-09