Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@zhike/axios-upload

Package Overview
Dependencies
Maintainers
12
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zhike/axios-upload

基于axios上传表单数据

latest
Source
npmnpm
Version
1.0.8
Version published
Maintainers
12
Created
Source

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
});

FAQs

Package last updated on 31 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts