Programming Language & Framework/JAVA & Spring
TIssue | DefaultHandlerExceptionResolver : Resolved [org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'text/plain;charset=UTF-8' not supported] 해결방법
읻민스
2023. 1. 21. 22:56
반응형
Postman을 사용해서 request, response 테스트를 진행하면서 발생한 오류 중 Contetn type 'text/plain; charset=UTF-8" not wupported에 대한 글이다.
DefaultHandlerExceptionResolver 에러 발생
에러
WARN 4203 --- [nio-8080-exec-7] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'text/plain;charset=UTF-8' not supported]
원인
Content-Type이 알맞지 않아서 발생한 오류이다.
해결방법
Headers 객체에서 Content-Typed을 text/plain에서 applicaion/json으로 변경해 주면된다.
주의
Postman에서는 Headers 객체 수정이 안될 수 있다. 이럴 땐 Body에서 JSON 항목을 선택해 주면 된다.
728x90
반응형