Skip to content

request/multipart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@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.