尝试了很多方法后,你能帮我解决这个问题。Php卷曲支持
始终返回{"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
感谢事先登录!
哪里是API的规格?该API接受哪些内容类型? – hakre