Error

HttpMediaTypeNotSupportedException: Content-Type 'text/plain;charset=UTF-8' is not supported 에러 해결

난감 2024. 7. 16. 11:48
728x90

오류

Resolved [org.springframework.web.HttpMediaTypeNotSupportedException: Content-Type 'text/plain;charset=UTF-8' is not supported]

 

postman 에서 post 메소드로 올바르게 전송했는데 위의 오류가 발생했다.

 

Body에 담을 때 raw - Text 를 선택해서 json 형식인지 인지하지 못해 발생한 문제이다.


 

 

해결

방법 1. Body - raw - JSON 으로 변경한다.

 

방법 2. Headers에 "Content-Type:application/json" 을 작성한다.

반응형