See @request/core for more details.
- oauth
{}see below - uri
url.parse()'d object - method
GET|POST..
- query
a=1&b=2 - form
a=1&b=2 - body
{a:1,b:2}
- consumer_key OAuth application key
- consumer_secret OAuth application secret
- private_key in PEM format, set this key instead of
consumer_secretwhen usingRSA-SHA1signing - token user's access token
- token_secret user's token secret
- version
1.0 - signature_method
HMAC-SHA1|RSA-SHA1|PLAINTEXT - transport_method type
header|query|form
- timestamp
- nonce
- signature
- realm
- body_hash pass you own Body Hash as string or pass
trueto get one generated for you
var result = oauth(options)
if (result instanceof Error) {
// handle error
}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
}This module may contain code snippets initially implemented in request by request contributors.