{"_id":"@ahutchings/http-browserify-worker-support","_rev":"1-ecfc642924ddfa4b2419324791a9457f","name":"@ahutchings/http-browserify-worker-support","description":"http module compatability for browserify","dist-tags":{"latest":"1.7.2"},"versions":{"1.7.2":{"name":"@ahutchings/http-browserify-worker-support","version":"1.7.2","description":"http module compatability for browserify","main":"index.js","browserify":"index.js","directories":{"lib":".","example":"example","test":"test"},"scripts":{"test":"tape test/*.js"},"dependencies":{"Base64":"~0.2.0","inherits":"~2.0.1"},"devDependencies":{"ecstatic":"~0.1.6","tape":"~2.3.2"},"repository":{"type":"git","url":"git+https://github.com/ahutchings/http-browserify.git"},"keywords":["http","browserify","compatible","meatless","browser"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT/X11","gitHead":"6fd5990aaba74f11d652246aa0a87e0586b02d6a","bugs":{"url":"https://github.com/ahutchings/http-browserify/issues"},"homepage":"https://github.com/ahutchings/http-browserify#readme","_id":"@ahutchings/http-browserify-worker-support@1.7.2","_npmVersion":"5.6.0","_nodeVersion":"9.4.0","_npmUser":{"name":"ahutchings","email":"andrew.hutchings@gmail.com"},"dist":{"integrity":"sha512-vi2H3ZDeM1O83sCbJqDapWpPCBUPqTokKw7bvUw79hHk932GL0NXtgo5djAhjY93Cu/OTRUO9Gvj/wOOlMMuMQ==","shasum":"5a60fa7bc693326709bf2d42dacc4481e5428906","tarball":"https://registry.npmjs.org/@ahutchings/http-browserify-worker-support/-/http-browserify-worker-support-1.7.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGDLberg78PoBCnoEnS3C8XXZUvru33ir6uuQp6+mDpqAiEAjS1tW6G5ZCPmavrM48WtW2H/BDy+EEY5wX7VPSy1zkA="}]},"maintainers":[{"name":"ahutchings","email":"andrew.hutchings@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-browserify-worker-support-1.7.2.tgz_1516224786307_0.21122180600650609"}}},"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","maintainers":[{"name":"ahutchings","email":"andrew.hutchings@gmail.com"}],"time":{"modified":"2022-04-04T12:14:34.508Z","created":"2018-01-17T21:33:07.217Z","1.7.2":"2018-01-17T21:33:07.217Z"},"homepage":"https://github.com/ahutchings/http-browserify#readme","keywords":["http","browserify","compatible","meatless","browser"],"repository":{"type":"git","url":"git+https://github.com/ahutchings/http-browserify.git"},"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"bugs":{"url":"https://github.com/ahutchings/http-browserify/issues"},"license":"MIT/X11","readmeFilename":"readme.markdown"}