index.js
function (options) {
        if (!$this._multipart) {
          $this.options.multipart = []
        }

        if (is(options).a(Object)) {
          if (options['content-type']) {
            var type = Unirest.type(options['content-type'], true)
            if (type) options.body = Unirest.Response.parse(options.body)
          } else {
            if (is(options.body).a(Object)) {
              options.body = Unirest.serializers.json(options.body)
            }
          }

          $this.options.multipart.push(options)
        } else {
          $this.options.multipart.push({
            body: options
          })
        }

        return $this
      }
function (options) {
        if (!$this._multipart) {
          $this.options.multipart = []
        }

        if (is(options).a(Object)) {
          if (options['content-type']) {
            var type = Unirest.type(options['content-type'], true)
            if (type) options.body = Unirest.Response.parse(options.body)
          } else {
            if (is(options.body).a(Object)) {
              options.body = Unirest.serializers.json(options.body)
            }
          }

          $this.options.multipart.push(options)
        } else {
          $this.options.multipart.push({
            body: options
          })
        }

        return $this
      }
function ( options ) { if ( ! $this . _multipart ) { $this . options . multipart = [ ] } if ( is ( options ) . a ( Object ) ) { if ( options [ 'content-type' ] ) { var type = Unirest . type ( options [ 'content-type' ] , true ) if ( type ) options . body = Unirest . Response . parse ( options . body ) } else { if ( is ( options . body ) . a ( Object ) ) { options . body = Unirest . serializers . json ( options . body ) } } $this . options . multipart . push ( options ) } else { $this . options . multipart . push ( { body : options } ) } return $this }
Takes multipart options and places them on `options.multipart` array.
Transforms body when an `Object` or _content-type_ is present.

Example:

Unirest.get('http://google.com').part({
'content-type': 'application/json',
body: {
phrase: 'Hello'
}
}).part({
'content-type': 'application/json',
body: {
phrase: 'World'
}
}).end(function (response) {})

@param  {Object|String} options When an Object, headers should be placed directly on the object,
not under a child property.
@return {Object}
Takes multipart options and places them on options . multipart array . Transforms body when an Object or _content - type_ is present .