에러 Trace 가 아니라 Response Error Body 확인 해보셔야한다는 의미였는데요.
Java 에서 HttpURLConnection 객체 사용하는 경우 아래와 같이 확인 할 수 있습니다.
InputStream stream = conn.getErrorStream();
if (stream != null) {
try (Scanner scanner = new Scanner(stream)) {
scanner.useDelimiter("\\Z");
response = scanner.next();
}
System.out.println("error response : " + response);
}
[rest api 예제] java (spring boot) - 카카오 로그인, 카카오 친구목록 조회, 메시지 발송
getKakaoToken에 파라메터로 전달하시는 code 값 텍스트로 기재 부탁드려요.