본문 바로가기
오류노트

springboot 에서 MultipartException: Current request is not a multipart request

by 어컴띵 2021. 8. 20.

postman에서 api를 테스트하다가 @RequestPart가 붙어 있고 파일을 업로드 하지 않으면 MultipartException: Current request is not a multipart request 이런 에러가 난다.

 

Validator를 적용하는데 그전에 에러가 나버리니 테스트를 할수가 없었다. 그래서 찾던중에 postman에서 header 부분에 다음과 같이 셋팅을 해주면 위와같은 에러가 나지 않는다.

 

postman에서 헤더부분을 클릭하고

Key : Content-type

value: Content-Type: multipart/form-data; boundary=----WebKitFormBoundarylTMBUUyXqgLqmAdj

 

이렇게 셋팅을 하니 오류가 나지않는다.

 

참조:

https://github.com/postmanlabs/postman-app-support/issues/576