request / multipart

HTTP Multipart Body Stream

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@request/multipart

See @request/core for more details.

var options = {
  // related
  multipart: [],
  // form-data
  multipart: {},

  // optional
  contentType: 'multipart/related; boundary=',
  boundary: '',
  preambleCRLF: true,
  postambleCRLF: true
}


var result = multipart(options)

result.contentType
result.body
// related
multipart: [{key: 'value', body: 'body'}]
multipart: [{key: 'value', body: 'body'}]

// form-data
multipart: {key: 'value'}
multipart: {key: ['value', 'value']}
multipart: {key: {
  value: 'value',
  options: {filename: '', contentType: '', knownLength: 0}
}}

Notice

This module may contain code snippets initially implemented in request by request contributors.

About

HTTP Multipart Body Stream

License:Apache License 2.0


Languages

Language:JavaScript 100.0%