Hello Everybody,I am new to alfresco, I am trying to integrate alfresco to my php application through webservice. I started with RestFull Api login method.I successfully got the ticket when i call the /alfresco/service/api/login with GET.I am wondering how to call the login through POST and get ticket (authenticated).this is what i did
$url = 'http://myserver/alfresco/service/api/login';
$aData = array( 'username'=>'admin',
'password'=> 'admin'
);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,array($aData));
$result = curl_exec($ch);
$response = curl_getinfo($ch);
curl_close($ch);
but it gives me following errorHTTP/1.1 400 Bad RequestServer: Apache-Coyote/1.1Transfer-Encoding: chunkedConnection: closei also tried with
$aData = array( 'username'=>'admin',
'password'=> 'admin'
);
$jsonenc = json_encode($aData);
curl_setopt($ch, CURLOPT_HEADER,array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_POSTFIELDS,array($jsonenc));
it didn't worked too. Can anybody please tell me what is wrong? what can be done?Thanks in advance,Dhaivat