嘗試了很多方法後,你能幫我解決這個問題。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