by kumar ret.
Thanks for the reply
I checked the same. But getting same problem ...
my code is ///
require_once('./curl.php');
$token = 'mytoken';
$functionname = 'mod_quiz_save_attempt';
$domainname = 'http://localhost/moodle';
$restformat = 'json';
$params=array('attemptid'=>1 , 'data' => array (array('name' => 'slot','value' => 1 ),array('name' =>'q1:1_:sequencecheck','value' => 1),array('name' =>'q1:1_answer','value' => 2)), 'preflightdata' => array (array('name' => "",'value' => "")));
$functionname = 'mod_quiz_save_attempt';
$serverurl = $domainname . '/webservice/rest/server.php'. '?wstoken=' . $token . '&wsfunction='.$functionname;
$curl = new curl;
$restformat = ($restformat == 'json')?'&moodlewsrestformat=' .$restformat:'';
$resp = $curl->post($serverurl . $restformat, $params);
print_r($resp);
Please check ... Thanks in advance