The request was rejected because no multipart boundary was found in springboot

前端 未结 9 1652
隐瞒了意图╮
隐瞒了意图╮ 2020-11-27 16:30

As I am trying this with spring boot and webservices with postman chrome add-ons.

In postman content-type=\"multipart/form-data\" and I am getting the b

相关标签:
9条回答
  • 2020-11-27 17:13

    The problem is that you are setting the Content-Type by yourself, let it be blank. Google Chrome will do it for you. The multipart Content-Type needs to know the file boundary, and when you remove the Content-Type, Postman will do it automagically for you.

    0 讨论(0)
  • 2020-11-27 17:15

    The "Postman - REST Client" is not suitable for doing post action with setting content-type.You can try to use "Advanced REST client" or others.

    Additionally, headers was replace by consumes and produces since Spring 3.1 M2, see https://spring.io/blog/2011/06/13/spring-3-1-m2-spring-mvc-enhancements. And you can directly use produces = MediaType.MULTIPART_FORM_DATA_VALUE.

    0 讨论(0)
  • 2020-11-27 17:15

    Heard you can do this in postman:

    0 讨论(0)
提交回复
热议问题