close

이 포스팅은 쿠팡 파트너스 활동의 일환으로, 이에 따른 일정액의 수수료를 제공받습니다.

linux/php

(PHP CURL)토스 페이먼트 API 응답없는 문제

mysop 2021. 9. 14. 15:10
728x90
반응형

토스페이먼트 API를 실제 테스트 코드만 받아서 돌려보면

 

POST로 전달후 응답이 안들어오고

HTTP코드가 415로 떨어진다..

 

이유가 먼지 검색해 보니 HEADER 정의가 샘플에 빠져서 그렇다

 

curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/json","Content-Type: application/json"));

 

이거 한줄만 넣어주면 응답 잘 들어온다.

 

너무 샘플만 보고 떠먹여주는데로 하다보면 삽질한다.

 

출처 : https://solbel.tistory.com/1242

 

[php] HTTP Status : 415 The server refused this request because the request entity is in a format not supported by the requested

[php] HTTP Status : 415 The server refused this request because the request entity is in a format not supported by the requested resource for the requested method 에러 해..

solbel.tistory.com

 

728x90
반응형