axios 模拟multipart/form-data

     let formData = new FormData();
          formData.append('appkey', 'njssdjtkj');
          formData.append('sign', sign);
          formData.append('sign_method', "MD5");
          formData.append('mobile', "15951971791");
          formData.append('engine_no', "070939");
          formData.append('plate_type', "02");
          formData.append('plate_no', "苏EXW365");


            axios({
              method: 'post',
              url: '/api/search.do',
              data:formData,
//              data:{appkey: "njssdjtkj",sign:sign,sign_method:"MD5",timestamp:time,mobile:"15951971791",engine_no:"070939",plate_type:"02",plate_no:"苏EXW365"},
              headers: {
                'Content-Type': 'multipart/form-data'
              }
            })
            .then(function (res) {
              console.log(res)
            })

推荐阅读更多精彩内容