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

curl-and-php

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

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

On Thu, 9 Aug 2007, Richard Lynch wrote:

> $headers = array('User-Agent: myagent', 'Host: somehost.com',
> '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: http://haxx.se/curl.html
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2007-08-09