在尝试了很多方法之后,你能帮我修复这个代码吗?
总是返回{"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
?>
是使用 PHP 登录
提前致谢!