API の REST 関数を GET プロトコルで呼び出したいのですが、restler のセキュリティ キーをポスト パラメータとして設定できませんでした。
例:
/index.php/myrestapi/method.json?name=テスト投稿フィールド: Array('key'=>'mykey')
$session = curl_init('<mydomainurl>/index.php/myrestapi/method.json?name=test');
// Tell curl that this is the body of the POST
curl_setopt ($session, CURLOPT_POSTFIELDS, array('key'=>'mykey');
// Tell curl not to return headers, but do return the response
curl_setopt($session, CURLOPT_HEADER, false);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($session);
Myrestapi.php 関数:
protected function getMethod($name){
return $name;
}
なにが問題ですか?!
よろしくお願いします。
ケビン