request-shared
Logic for normalizing arguments for an http request
Installation
npm install request-shared
Request
var Request = Request;var req = 'http://www.example.com' method: 'post';
Response
var Response = Response;var res = 200 {} 'A ok';//res.statusCode === 200//res.headers === {}//res.body === new Buffer('A ok')res;// => new Buffer('A ok') var res = 404 'Header': 'value' 'Wheres this page';//res.statusCode === 404//res.headers === {header: 'value'}//res.body === new Buffer('Wheres this page')res;// => throws error with `statusCode`, `headers` and `body` properties.
License
MIT