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

curl-and-php

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

From: Richard Lynch <ceo_at_l-i-e.com>
Date: Thu, 9 Aug 2007 00:34:57 -0500 (CDT)

On Wed, August 8, 2007 10:51 am, YS.PRO wrote:
> So I need to send xml-rpc message:
>
>
> POST /rpc HTTP/1.0
> User-Agent: myagent
> Host: somehost.com
> Content-Type: *text/xml*
> Content-length: 250
> XML message
>
> <?xml version="1.0"?>
> <methodCall>
> <methodName>weblogUpdates.ping</methodName>
> <params>
> <param>
> <value>myblog</value>
> </param>
> <param>
> <value>http://www.myblog.com/</value>
> </param>
> </params>
> </methodCall>

$headers = array('User-Agent: myagent', 'Host: somehost.com',
'Content-type: text/xml', 'Content-length: 250');
$curl = curl_init();
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);

There are several more examples here:
http://php.net/curl_setopt

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2007-08-09