Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

request-multipart

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

request-multipart

Multipart Body Stream

  • 0.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
106K
decreased by-0.06%
Maintainers
1
Weekly downloads
 
Created
Source

request-multipart

npm-version travis-ci coveralls-status

multipart/form-data and multipart/related support for request-compose

var compose = require('request-compose')
compose.Request.multipart = require('request-multipart')
var fs = require('fs')

;(async () => {
  try {
    var {body} = await compose.client({
      method: 'POST',
      url: 'https://slack.com/api/files.upload',
      qs: {title: 'My Awesome Cat!'},
      headers: {authorization: 'Bearer [ACCESS TOKEN]'},
      multipart: {file: fs.readFileSync('cat.png')}
    })
    console.log(body)
  }
  catch (err) {
    console.error(err)
  }
})()

Table of Contents

multipart/form-data

value can be String, Buffer or Stream

multipart: {
  key: 'value'
}
multipart: {
  key: [
    'value',
    'value',
  ]
}
multipart: {
  key: {
    value: 'value',
    options: {filename: '', contentType: '', knownLength: 0}
  }
}

multipart/related

body can be String, Buffer or Stream

multipart: [
  {key: 'value', body: 'body'},
  {key: 'value', body: 'body'},
]

Keywords

FAQs

Package last updated on 04 May 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc