I get this error: "Method Not Allowed: O" Status: 405.
It would help if anyone had any working examples of PHP cURL using "PUT". I do not use mod_rewrite for this. So my calls are towards example:
"api.php?_d=orders&order_id=1"
My code (Real passwords, usernames and url is omitted in example):
--------------------------------------------------------------------
$order_data = json_encode(array('timestamp' => 1382548160) );
$order_id = "13752";
$query_string = "?_d=orders&order_id=$order_id";
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_URL, 'http://example.com/api.php'.$query_string);
curl_setopt($ch, CURLOPT_USERPWD, $usr . ":" . $pass);
curl_setopt($ch, CURLOPT_POSTFIELDS,$order_data);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($order_data))
);
$result = curl_exec($ch);
echo $result;
curl_close($ch);
--------------------------------------------------------------------
Hope any one can help.
