{"name":"http-response-object","version":"3.0.0","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":"^9.3.0"},"devDependencies":{"flowgen2":"^2.0.0-alpha.5","typescript":"^2.3.4"},"gitHead":"654fcaaff46b1692283c0412c7fa45c9e17f8eb0","bugs":{"url":"https://github.com/ForbesLindesay/http-response-object/issues"},"homepage":"https://github.com/ForbesLindesay/http-response-object#readme","_id":"http-response-object@3.0.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"},"dist":{"integrity":"sha512-K0WKJdxMpmelz7JP+jxRn01mecq6Bo4sMA61mcHrRTR89r5SRSSfP2cqIQAK6bRa01Hd56Sjpq4En/vV/AY2OA==","shasum":"78432422b1ddf2fe5f05825a1778f6a58820f9af","tarball":"http://registry-npm.ywwl.com/http-response-object/download/http-response-object-3.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPPiVhUIwZhB/MbPIKops9Fv9UkuGktlcgameFIaI09gIhAKKE8sEtMD6AnDFDUipElLFKMUBiaUONnkrN4/LzFBu0"}],"size":2807,"noattachment":false,"key":"/http-response-object/-/http-response-object-3.0.0.tgz"},"maintainers":[{"name":"forbeslindesay","email":"forbes@lindeay.co.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-response-object-3.0.0.tgz_1517394479351_0.5823880033567548"},"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":1517394480284,"_cnpm_publish_time":1517394480284,"dist-tags":{"latest":"3.0.2"}}