한 번만 더 해보자

[Spring] Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported 본문

Spring

[Spring] Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported

정 하임 2024. 1. 18. 22:12

원인 

다른 POST 통신할 때와 동일하게 모델을 @RequestBody 로 받으려고했기 때문

 

 

해결

@RequestBody 대신 @ModelAttribute로 받기

 

 

@RequestBody 

body 에 있는 json 데이터를 파싱해줌

 

 

반응형