Я создал веб-сервисы в рамках рестлера и пытаюсь вставить данные с помощью curl в php из клиентской библиотеки, которую я создал.
api.php
/**
* Manually routed method. we can specify as many routes as we want
*
* @url POST addcomment/{token}/{email}/{comment}/{story_id}
*/
function addComment($token,$email,$comment,$story_id){
return $this->dp->insertComment($token,$email,$comment,$story_id);
}
для целей тестирования от клиента: testing.php
$data_string = "token=900150983cd24fb0d6963f7d28e17f72&[email protected]&comment=commentusingcurl&story_id=2";
$ch = curl_init('http://localhost/Restler/public/examples/news/addcomment');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
//curl_setopt($ch, CURLOPT_HTTPHEADER,array("Content-Type : text","Content-lenght:".strlen($data_string)));
$result = curl_exec($ch);
но выдает 404. Пожалуйста помоги.
GET
, если он работает. :) - person Yogesh Suthar   schedule 15.02.2013