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

前端 未结 9 1632
隐瞒了意图╮
隐瞒了意图╮ 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 16:48

    When I use postman to send a file which is 5.6M to an external network, I faced the same issue. The same action is succeeded on my own computer and local testing environment.

    After checking all the server configs and HTTP headers, I found that the reason is Postman may have some trouble simulating requests to external HTTP requests. Finally, I did the sendfile request on the chrome HTML page successfully. Just as a reference :)

    0 讨论(0)
  • 2020-11-27 16:51

    I was having the same problem while making a POST request from Postman and later I could solve the problem by setting a custom Content-Type with a boundary value set along with it like this.

    I thought people can run into similar problem and hence, I'm sharing my solution.

    0 讨论(0)
  • 2020-11-27 16:57

    Unchecked the content type in Postman and postman automatically detect the content type based on your input in the run time.

    0 讨论(0)
  • 2020-11-27 16:59

    I met this problem because I use request.js which writen base on axios
    And I already set a defaults.headers in request.js

    import axios from 'axios'
    const request = axios.create({
      baseURL: '', 
      timeout: 15000 
    })
    service.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'
    

    here is how I solve this
    instead of

    request.post('/manage/product/upload.do',
          param,config
        )
    

    I use axios directly send request,and didn't add config

    axios.post('/manage/product/upload.do',
          param
        )
    

    hope this can solve your problem

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

    Newer versions of ARC(Advaced Rest client) also provides file upload option:

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

    This worked for me: Uploading a file via Postman, to a SpringMVC backend webapp:

    Backend:

    Postman:

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