{"name":"http-browserify","version":"0.1.1","description":"http module compatability for browserify","main":"index.js","browserify":"index.js","directories":{"lib":".","example":"example","test":"test"},"devDependencies":{"express":"2.5.x","browserify":"1.9.x"},"repository":{"type":"git","url":"git://github.com/substack/http-browserify.git"},"keywords":["http","browserify","compatible","meatless","browser"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT/X11","engine":{"node":">=0.4"},"_npmUser":{"name":"substack","email":"mail@substack.net"},"_id":"http-browserify@0.1.1","dependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"d9d82735a5f85f950761ac3909ba9485ec0af4f1","tarball":"http://registry-npm.ywwl.com/http-browserify/download/http-browserify-0.1.1.tgz","integrity":"sha512-0j9TM1JJw1Vic4tKnE/xnuQcjCiLma2iUcOaoVhMS7r9jM5ZEzSwGMYr6UAssoQ6wCZximFkOwI4gRkSzpguOw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID1in/UWm1AaL8pPp2z9h3YalMBCAAH+cLaADyKwdugSAiEAhQ+rI4wgdj4HqtuoZoiJCFmmjxHyVrFA5ZRuKhHgkR0="}],"size":4268,"noattachment":false,"key":"/http-browserify/-/http-browserify-0.1.1.tgz"},"maintainers":[{"name":"substack","email":"mail@substack.net"}],"readme":"# http-browserify\n\nThe\n[http](http://nodejs.org/docs/v0.4.10/api/all.html#hTTP) module from node.js,\nbut for browsers.\n\nWhen you `require('http')` in\n[browserify](http://github.com/substack/node-browserify),\nthis module will be loaded.\n\n# example\n\n``` js\nvar http = require('http');\n\nhttp.get({ path : '/beep' }, function (res) {\n    var div = document.getElementById('result');\n    div.innerHTML += 'GET /beep<br>';\n    \n    res.on('data', function (buf) {\n        div.innerHTML += buf;\n    });\n    \n    res.on('end', function () {\n        div.innerHTML += '<br>__END__';\n    });\n});\n```\n\n# http methods\n\nvar http = require('http');\n\n## var req = http.request(opts, cb)\n\nwhere `opts` are:\n\n* `opts.method='GET'` - http method verb\n* `opts.path` - path string, example: `'/foo/bar?baz=555'`\n* `opts.headers={}` - as an object mapping key names to string or Array values\n* `opts.host=window.location.host` - http host\n* `opts.port=window.location.port` - http port\n* `opts.responseType` - response type to set on the underlying xhr object\n\nThe callback will be called with the response object.\n\n## var req = http.get(options, cb)\n\nA shortcut for\n\n``` js\noptions.method = 'GET';\nvar req = http.request(options, cb);\nreq.end();\n```\n\n# request methods\n\n## req.setHeader(key, value)\n\nSet an http header.\n\n## req.getHeader(key)\n\nGet an http header.\n\n## req.removeHeader(key)\n\nRemove an http header.\n\n## req.write(data)\n\nWrite some data to the request body.\n\nIf only 1 piece of data is written, `data` can be a FormData, Blob, or\nArrayBuffer instance. Otherwise, `data` should be a string or a buffer.\n\n## req.end(data)\n\nClose and send the request body, optionally with additional `data` to append.\n\n# response methods\n\n## res.getHeader(key)\n\nReturn an http header, if set. `key` is case-insensitive.\n\n# response attributes\n\n* res.statusCode, the numeric http response code\n* res.headers, an object with all lowercase keys\n\n# compatibility\n\nThis module has been tested and works with:\n\n* Internet Explorer 5.5, 6, 7, 8, 9\n* Firefox 3.5\n* Chrome 7.0\n* Opera 10.6\n* Safari 5.0\n\nMultipart streaming responses are buffered in all versions of Internet Explorer\nand are somewhat buffered in Opera. In all the other browsers you get a nice\nunbuffered stream of `\"data\"` events when you send down a content-type of\n`multipart/octet-stream` or similar.\n\n# protip\n\nYou can do:\n\n````javascript\nvar bundle = browserify({\n    require : { http : 'http-browserify' }\n});\n````\n\nin order to map \"http-browserify\" over `require('http')` in your browserified\nsource.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install http-browserify\n```\n\n# license\n\nMIT\n","publish_time":1330330363295,"_cnpm_publish_time":1330330363295,"dist-tags":{"latest":"1.7.0"}}