{"name":"http-response-object","version":"2.0.3","main":"lib/index.js","types":"lib/index.d.ts","files":["lib"],"description":"A simple object to represent an http response","keywords":["http","https","response","request"],"scripts":{"prepublishOnly":"npm run build","build":"tsc && flowgen lib/**/*","pretest":"npm run build","test":"node test"},"repository":{"type":"git","url":"git+https://github.com/ForbesLindesay/http-response-object.git"},"author":{"name":"ForbesLindesay"},"license":"MIT","dependencies":{"@types/node":"^7.0.31"},"devDependencies":{"flowgen2":"^2.0.0-alpha.5","typescript":"^2.3.4"},"gitHead":"9a6f09bcd000b9bc7ded9d77871bea0c08c4de0b","bugs":{"url":"https://github.com/ForbesLindesay/http-response-object/issues"},"homepage":"https://github.com/ForbesLindesay/http-response-object#readme","_id":"http-response-object@2.0.3","_npmVersion":"5.0.3","_nodeVersion":"8.0.0","_npmUser":{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"},"maintainers":[{"name":"forbeslindesay","email":"forbes@lindeay.co.uk"}],"dist":{"integrity":"sha512-qWk3Svyl+SnYYSRuN6m0yiAbmCNBH6Q1HHbOBViEmsrO1TlGYsBSAiI8gDv95wMAV+f4I9JLbUM7gkRTLaFuLQ==","shasum":"530a48c3b6b683be2398fc42417f7c54f8b401a8","tarball":"http://registry-npm.ywwl.com/http-response-object/download/http-response-object-2.0.3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAsHnsDV/lrTwQ5W8roOYtWp502hoKUsxCR9XuKD3oOrAiEA9amZk8H7FE7U7SbIW3PUMo3VWurF/h1kYUWMdsTaR3E="}],"size":2660,"noattachment":false,"key":"/http-response-object/-/http-response-object-2.0.3.tgz"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-response-object-2.0.3.tgz_1497607048896_0.133782843593508"},"directories":{},"readme":"# http-response-object\n\nA simple object to represent an http response (with flow and typescript types)\n\n[![Build Status](https://img.shields.io/travis/ForbesLindesay/http-response-object/master.svg)](https://travis-ci.org/ForbesLindesay/http-response-object)\n[![Dependency Status](https://img.shields.io/david/ForbesLindesay/http-response-object.svg)](https://david-dm.org/ForbesLindesay/http-response-object)\n[![NPM version](https://img.shields.io/npm/v/http-response-object.svg)](https://www.npmjs.org/package/http-response-object)\n\n\n## Installation\n\n    npm install http-response-object\n\n## Usage\n\n```js\nvar Response = require('http-response-object');\nvar res = new Response(200, {}, new Buffer('A ok'), 'http://example.com');\n//res.statusCode === 200\n//res.headers === {}\n//res.body === new Buffer('A ok')\n//res.url === 'http://example.com'\nres.getBody();\n// => new Buffer('A ok')\n\nvar res = new Response(404, {'Header': 'value'}, new Buffer('Wheres this page'), 'http://example.com');\n//res.statusCode === 404\n//res.headers === {header: 'value'}\n//res.body === new Buffer('Wheres this page')\n//res.url === 'http://example.com'\nres.getBody();\n// => throws error with `statusCode`, `headers`, `body` and `url` properties copied from the response\n```\n\n## Properties\n\n - `statusCode`: Number - the status code of the response\n - `headers`: Object - the headers of the response.  The keys are automatically made lower case.\n - `body`: Buffer | String - the body of the response. Should be a buffer on the server side, but may be a simple string for lighter weight clients.\n - `url`: String - the url that was requested.  If there were redirects, this should be the last url to get requested.\n\n## License\n\n  MIT\n","publish_time":1497607049837,"_cnpm_publish_time":1497607049837,"dist-tags":{"latest":"3.0.2"}}