이 내가 생각PHP POST 요청 및 unsupported_grant_type
$data = array(
'grant_type' => 'Password',
'username' => 'username',
'password' => 'pwd',
'DeviceId' => ''
);
$url = "http://test/sync/oauth/token";
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($curl);
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($status != 201) {
die("Error: call to URL $url failed with status $status, response $response, curl_error " . curl_error($curl) . ", curl_errno " . curl_errno($curl));
}
curl_close($curl);
print_r($response);`
가 올바른지 내 코드이지만, 서버는 나에게이 오류
Error: call to URL http://test/sync/oauth/token failed with status 400, response {"error":"unsupported_grant_type"}, curl_error , curl_errno 0
오류가를 반환?
컬 년대 잘 작동 : 그것을 필요로하는 사람들을 위해
– CD001예, 올바르지 만 오류는 남아 있습니다. 오류 : URL http://test.audipsp.volkswagengroup.it/sync/oauth/token으로 전화하면 상태 400, 응답 HTTP/1.1로 실패합니다. 계속 예 맞아,하지만 오류가 남아 : HTTP/1.1 400 잘못된 요청 캐시 제어 : 노 캐시 에서 Pragma : 노 캐시 콘텐츠 길이 : 34 콘텐츠 형식 : 응용 프로그램/JSON; 문자셋 = UTF- 8 만료 : -1 서버 : Microsoft-IIS/8.5 X-Powered-By : ASP.NET 날짜 : 2016 년 7 월 19 일 10:29:27 GMT 오류가 조금 변경되었지만 unsupported_grant_type이 동일 함 : '오류 : URL http : // test/sync/oauth/token으로 실패 함 : failed with : "오류 :"unsupported_grant_type "}, curl_error, curl_errno 0 –