I would like to call a rest function of my api with the GET protocol but I didn't succeed to put the security key of restler as a post parameter.
example:
/index.php/myrestapi/method.json?name=test post field : 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 function:
protected function getMethod($name){
return $name;
}
What is wrong?!
Thanks in advance for your help!
Kevin