@zhike/axios-upload

基于axios上传表单数据

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
11Jan 5, 2021May 25, 2018Minified + gzip package size for @zhike/axios-upload in KB

Readme

axios-upload

node 中在 axios 基础上上传表单数据

npm npm

GitHub forks GitHub stars

Installation

npm i @zhike/axios-upload 

example

const axiosUpload = require('axios-upload');

// 这里直接将 stream 传入即可
// 文件默认上传最大为100M,若需修改,使用maxContentLength参数,单位byte
const data = {
  name: 'test',
  filedata: fs.createReadStream('./test.png')
};

await axiosUpload({
  url: 'http://xxx.xxx/test',
  method: 'post',
  headers: {
    'cache-control': 'no-cache'
  },
  data: data
});

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.