open-index/open-npm huggingface dataset:
npm package: @request/multipart
Description: HTTP Multipart Body Stream
Author: Simeon Velichkov
Latest version: 0.1.1


# @request/multipart

> See [@request/core][request-core] for more details.


```js
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
```

```js
// 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][request] by [request contributors][request-contributors].


  [request]: https://github.com/request/request
  [request-contributors]: https://github.com/request/request/graphs/contributors
  [request-core]: https://github.com/request/core
npm package: @request/oauth
Description: HTTP OAuth Authentication
Author: Simeon Velichkov
Latest version: 0.1.0


# @request/oauth

> See [@request/core][request-core] for more details.


## Options

###### Required

- **oauth** `{}` see below
- **uri** `url.parse()`'d object
- **method** `GET` | `POST` ..

###### Optional

- **query** `a=1&b=2`
- **form** `a=1&b=2`
- **body** `{a:1,b:2}`


## OAuth Options

###### Required

- **consumer_key** OAuth application key
- **consumer_secret** OAuth application secret
- **private_key** in [PEM format][pem-format], set this key instead of `consumer_secret` when using `RSA-SHA1` signing
- **token** user's access token
- **token_secret** user's token secret

###### Defaults

- **version** **`1.0`**
- **signature_method** **`HMAC-SHA1`** | `RSA-SHA1` | `PLAINTEXT`
- **transport_method** [type][transport-method] **`header`** | `query` | `form`

###### Generated

- **timestamp**
- **nonce**
- **signature**

###### Optional

- **realm**
- **body_hash** pass you own [Body Hash][body-hash] as string or pass `true` to get one generated for you


## Result

###### Error

```js
var result = oauth(options)
if (result instanceof Error) {
  // handle error
}
```

###### Success

```js
var result = oauth(options)

var transport = options.oauth.transport_method || 'header'
if (transport === 'header') {
  req.headers['authorization'] = result
}
else if (transport === 'query') {
  // append result to your querystring
}
else if (transport === 'body') {
  // append result to your form body
}
```


## Notice

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


  [request]: https://github.com/request/request
  [request-contributors]: https://github.com/request/request/graphs/contributors

  [pem-format]: http://how2ssl.com/articles/working_with_pem_files/
  [body-hash]: https://oauth.googlecode.com/svn/spec/ext/body_hash/1.0/oauth-bodyhash.html
  [transport-method]: http://oauth.net/core/1.0/#consumer_req_param
  [request-core]: https://github.com/request/core