After trying a lot of ways, can you help me to fix this code.
Always returns {"code":201,"error":"missing user password"}
<?php
$APPLICATION_ID = "XXXXXXXXXXXXXx";
$REST_API_KEY = "XXXXXXXXXXXX";
$url = 'https://api.parse.com/1/login';
$headers = array(
'X-Parse-Application-Id: ' . $APPLICATION_ID,
'X-Parse-REST-API-Key: ' . $REST_API_KEY,
//option 1
//urlencode('username=xxxxxx'),
//urlencode('password=xxxxxxx'),
);
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_TIMEOUT, '3');
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
//option 2
//curl_setopt($curl, CURLOPT_ENCODING, 'username=xxxxx');
//curl_setopt($curl, CURLOPT_ENCODING, 'password=xxxxxxx');
$content = curl_exec($curl); curl_close($curl);
print $content
?>
Is a login using PHP
Thanks in advance!
You need to pass this data as following:
Then pass the data as follows: