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

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

提交回复
热议问题