,捲曲
http://www.php.net/manual/en/ref.curl.php
$curl_handle = curl_init();
if (!$curl_handle) {
die('fail to initialize');
}
curl_setopt($curl_handle, CURLOPT_TIMEOUT, 30);
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 30);
//target URL setup
curl_setopt($curl_handle, CURLOPT_URL, 'https://destination.cm/fg');
//mime type setup, change if necessary
curl_setopt($curl_handle, CURLOPT_HTTPHEADER, array("Content-Type: application/xml"));
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_handle, CURLOPT_FAILONERROR, 1);
curl_setopt($curl_handle, CURLOPT_POST, 1);
//here you assign the body of your request
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $xmlVariable);
$response = curl_exec($curl_handle);
if (curl_errno($curl_handle)) {
die(curl_error($curl_handle));
}
printf("Received :\n%s", $response);
這取決於目標預計它的格式。HTTP PUT請求?使用XML作爲給定字段名稱的值來編碼編碼數據?還有別的嗎? – Quentin 2010-10-01 23:06:48