Php curl post 방식으로 사용자 정보 가져오기 오류 문의

토큰값을 받은후에 사용자 정보를 요청 하면 오류가 발생합니다.

사용자 정보 요청하는 코드는 아래와 같이 되어있습니다.

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $this->profile_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authrization: Bearer '.$this->access_token));

$json = curl_exec($ch);

curl_close($ch);

if($json){
    return json_decode($json);
}

결과 값이 나오지 않아 json_decode 을 빼고 출력하면

Request Entity Too Large

The requested resource
/v1/user/me
does not allow request data with POST requests, or the amount of data provided in the request exceeds the capacity limit. 400

이렇게 메세지가 나옵니다… 이럴경우 어떻게 하면 될까요…ㅠㅠ

$this -> profile 값이 어떻게 되나요?

$this-> profile_url 값은

https://kapi.kakao.com/v1/user/me

이 주소로 셋팅 되어있습니다.

appKey와 사용하신 accessToken값을 쪽지로 알려주시면 로그를 살펴보도록 할게요.

서버쪽 로그에는 남는게 없네요. 보여주신 로그상으로는 PHP 설정 문제일 것 같은데요.
CURLOPT_POST 을 설정하셨는데
CURLOPT_POSTFIELDS 는 설정이 안되어 있어서 그럴지도 모르겠네요.
그 외에도 여러 상황에서 해당 에러가 나타날 수 있는 것 같습니다.

2개의 좋아요