{"_id":"browser-request","_rev":"44-cf654b9fc3d03e95318eb70dbe6526b1","name":"browser-request","description":"Browser port of the Node.js 'request' package","dist-tags":{"latest":"0.3.3"},"versions":{"0.1.0-beta1":{"name":"browser-request","version":"0.1.0-beta1","author":{"name":"Jason Smith","email":"jhs@iriscouch.com"},"description":"Browser port of the Node.js 'request' package","keywords":["request","http","browser","ender"],"homepage":"http://github.com/iriscouch/browser-request","repository":{"type":"git","url":"git://github.com/iriscouch/browser-request.git"},"dependencies":{},"devDependencies":{"tap":"0.1.3"},"engines":["node"],"ender":"./build/ender/ender.js","_npmUser":{"name":"jhs","email":"jhs@iriscouch.com"},"_id":"browser-request@0.1.0-beta1","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"9db4fb96f089356f3024c65850867dc44f85be5a","tarball":"https://registry.npmjs.org/browser-request/-/browser-request-0.1.0-beta1.tgz","integrity":"sha512-A4dNMD3PeFAfprHy7KQiL4RI2eC7V+7/s9anXPFCTKiMqEoms0lmKLn1j1PeoEWrMl6F16ZFusVm0o9Luq0D/g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICsY9nisCqxcBl9Zu9TawBuW1eUNEzaAH5KdKhY6qZ72AiEAlF+jOlQR4XAAUvB6MdrbJVqRAuxp6thpXAFqmq2bses="}]},"maintainers":[{"name":"jhs","email":"jhs@iriscouch.com"}]},"0.1.0-beta2":{"name":"browser-request","version":"0.1.0-beta2","author":{"name":"Jason Smith","email":"jhs@iriscouch.com"},"description":"Browser port of the Node.js 'request' package","keywords":["request","http","browser","ender"],"homepage":"http://github.com/iriscouch/browser-request","repository":{"type":"git","url":"git://github.com/iriscouch/browser-request.git"},"dependencies":{},"devDependencies":{"tap":"0.1.3"},"engines":["node"],"ender":"./release/ender/ender.js","_npmUser":{"name":"jhs","email":"jhs@iriscouch.com"},"_id":"browser-request@0.1.0-beta2","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"48e942ec27b23e4149515d9aac3b44525e560e34","tarball":"https://registry.npmjs.org/browser-request/-/browser-request-0.1.0-beta2.tgz","integrity":"sha512-Tz+IIY8wiKUGPpU75/lUZpfsxZJX+5PB7ZGwQJZ1rKRh2iP2EZP/nMgm3nbVaUfIrCPdqWE+Dh4VjViEV5aG/g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDbhY7tSrdSu1THqzAjkCdQHKjBhHxvjvhTDPw9WEH2RQIhAKFBHf07XiKgivgaJ2F9kknMsSC28A/WjM63aGkk+sm7"}]},"maintainers":[{"name":"jhs","email":"jhs@iriscouch.com"}]},"0.1.0":{"name":"browser-request","version":"0.1.0","author":{"name":"Jason Smith","email":"jhs@iriscouch.com"},"description":"Browser port of the Node.js 'request' package","keywords":["request","http","browser","ender"],"homepage":"http://github.com/iriscouch/browser-request","repository":{"type":"git","url":"git://github.com/iriscouch/browser-request.git"},"dependencies":{},"devDependencies":{"tap":"0.1.3","ender":"~0.8.2"},"engines":["node"],"ender":"./dist/ender/ender.js","_npmUser":{"name":"jhs","email":"jhs@iriscouch.com"},"_id":"browser-request@0.1.0","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"db0f71781ee7467e7562697209f4a7392526bcb5","tarball":"https://registry.npmjs.org/browser-request/-/browser-request-0.1.0.tgz","integrity":"sha512-/VG5uG7HOPJtdHpLrsgJuPXfa9lDqQIe45n5WOknuErkOgDq3NilTANsW89XEGhwe8YoDIqaIMRz3wiltm/ATA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDcUc+nRehqgBmpjB33IPEroWLlMMZwjqGEfuekC3KC2QIhALurMav3YWqvvMSvzCX0dTxvcjKYy/Aqjor9vTgpwpCi"}]},"maintainers":[{"name":"jhs","email":"jhs@iriscouch.com"}]},"0.2.0":{"name":"browser-request","version":"0.2.0","author":{"name":"Jason Smith","email":"jhs@iriscouch.com"},"description":"Browser port of the Node.js 'request' package","keywords":["request","http","browser","ender","browserify"],"homepage":"http://github.com/iriscouch/browser-request","repository":{"type":"git","url":"git://github.com/iriscouch/browser-request.git"},"dependencies":{},"devDependencies":{"tap":"0.1.3","ender":"~0.8.2","static-plus":"~0.2.4","uglify-js":"~1.2.5","browserify":"~1.10.6"},"engines":["node"],"ender":"./dist/ender/ender.js","browserify":"./dist/ender/request.js","_npmUser":{"name":"jhs","email":"jhs@iriscouch.com"},"_id":"browser-request@0.2.0","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"0ab38f5a42cebfed72edcaf992a0701deb0223b3","tarball":"https://registry.npmjs.org/browser-request/-/browser-request-0.2.0.tgz","integrity":"sha512-S7h76A/G16yofgfzKj1aM4hNZg+OLDafvjcF85dklcusba4yoAdt9o0vHraeyMO1sCDAaPFDP14NHZAb+hTJNg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD9fUeZUSAyMniKPGOjOUwrDAZ69zYBvmbmTfQApRRObgIhAMfuTVTACThpXLAKDbomWeRgFhxT0kf/nOQkKDc1RPrg"}]},"maintainers":[{"name":"jhs","email":"jhs@iriscouch.com"}]},"0.2.1":{"name":"browser-request","version":"0.2.1","author":{"name":"Jason Smith","email":"jhs@iriscouch.com"},"description":"Browser port of the Node.js 'request' package","keywords":["request","http","browser","ender","browserify"],"homepage":"http://github.com/iriscouch/browser-request","repository":{"type":"git","url":"git://github.com/iriscouch/browser-request"},"dependencies":{},"devDependencies":{"tap":"0.1.3","ender":"~0.8.2","static-plus":"~0.2.4","uglify-js":"~1.2.5","browserify":"~1.10.6"},"engines":["node"],"ender":"./dist/ender/ender.js","browserify":"./dist/ender/request.js","_id":"browser-request@0.2.1","dist":{"shasum":"fccb1156655e39021224df20584485e01c907b9d","tarball":"https://registry.npmjs.org/browser-request/-/browser-request-0.2.1.tgz","integrity":"sha512-NAD9snYr7/DHc8evlZy1Pg/ijB1x/s1oXnDqRNiQ2eVMnZ5UOGfO6/cza5LNS8QVFjY6XyKRuVoG9Laxfjq2PQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhCFKjMe81eOY0Nlqog9QLIotqIiv5CjdlqJHJEuU1kAIgGEe3BpR6qZNStkeypXfyw7p9oK+qxwrkAO1TCE/0eek="}]},"_from":".","_npmVersion":"1.2.1","_npmUser":{"name":"jhs","email":"jhs@iriscouch.com"},"maintainers":[{"name":"jhs","email":"jhs@iriscouch.com"}]},"0.3.0":{"name":"browser-request","version":"0.3.0","author":{"name":"Jason Smith","email":"jhs@iriscouch.com"},"description":"Browser port of the Node.js 'request' package","keywords":["request","http","browser","browserify"],"homepage":"http://github.com/iriscouch/browser-request","repository":{"type":"git","url":"git://github.com/iriscouch/browser-request"},"scripts":{"test":"beefy test.js"},"devDependencies":{"tape":"~1.0.4","beefy":"~0.4.0","browserify":"~2.25.0"},"engines":["node"],"testling":{"files":"test.js","browsers":["ie/6..latest","firefox/3..5","firefox/19..nightly","chrome/4..7","chrome/24..canary","opera/10..next","safari/4..latest","iphone/6","ipad/6"]},"_id":"browser-request@0.3.0","dist":{"shasum":"2c9b27006572b171f2e2f38e1b7ef476f6c28032","tarball":"https://registry.npmjs.org/browser-request/-/browser-request-0.3.0.tgz","integrity":"sha512-VMvKNNd2n1pvquJJMZfMbiKl8HFi6wyGuPNTSBioABhhyYNDuphtxEhIJCQ+E02R0aTpHaStoTHW1UefmqxgYQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCo98PmVgao221f9OGh2Td+x8sjGPOmVbZ8WinJeZpFcwIgEfMzjqi9y8o78G8AusRYJze5OI9lgoPxWpcDZ+VmjyE="}]},"_from":".","_npmVersion":"1.2.17","_npmUser":{"name":"jhs","email":"jhs@iriscouch.com"},"maintainers":[{"name":"jhs","email":"jhs@iriscouch.com"},{"name":"maxogden","email":"max@maxogden.com"}]},"0.3.1":{"name":"browser-request","version":"0.3.1","author":{"name":"Jason Smith","email":"jhs@iriscouch.com"},"description":"Browser port of the Node.js 'request' package","keywords":["request","http","browser","browserify"],"homepage":"http://github.com/iriscouch/browser-request","repository":{"type":"git","url":"git://github.com/iriscouch/browser-request"},"scripts":{"test":"beefy test.js"},"devDependencies":{"tape":"~1.0.4","beefy":"~0.4.0","browserify":"~2.25.0"},"engines":["node"],"testling":{"files":"test.js","browsers":["ie/6..latest","firefox/3..5","firefox/19..nightly","chrome/4..7","chrome/24..canary","opera/10..next","safari/4..latest","iphone/6","ipad/6"]},"contributors":[{"name":"Jason Smith Work","email":"jhs@iriscouch.com"},{"name":"Jason Smith","email":"jason.h.smith@gmail.com"},{"name":"maxogden","email":"max@maxogden.com"}],"_id":"browser-request@0.3.1","dist":{"shasum":"4c01f0bda68de746a59e49db917558c9a583646f","tarball":"https://registry.npmjs.org/browser-request/-/browser-request-0.3.1.tgz","integrity":"sha512-7NIj+/W94eKzu72uUZhu/sV6eBEtb7TkUoYWSM58LegcnW8rwMQIxNfWLPmd7edFRXB2siFWhFi/fvBAk+LQ+A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDaSiVDNjrOeEsJ4+TvSJiOhGcbr4RA/ZCFFLPSLdslrAiEAkmG+rW0rTwTgnT97O/4n8DYI2Q4lPaMKLXm4sCIekyI="}]},"_from":".","_npmVersion":"1.2.17","_npmUser":{"name":"jhs","email":"jhs@iriscouch.com"},"maintainers":[{"name":"jhs","email":"jhs@iriscouch.com"},{"name":"maxogden","email":"max@maxogden.com"}]},"0.3.2":{"name":"browser-request","version":"0.3.2","author":{"name":"Jason Smith","email":"jhs@iriscouch.com"},"description":"Browser port of the Node.js 'request' package","keywords":["request","http","browser","browserify"],"homepage":"http://github.com/iriscouch/browser-request","repository":{"type":"git","url":"git://github.com/iriscouch/browser-request"},"scripts":{"test":"beefy test.js"},"devDependencies":{"tape":"~1.0.4","beefy":"~0.4.0","browserify":"~2.25.0"},"engines":["node"],"testling":{"files":"test.js","browsers":["ie/6..latest","firefox/3..5","firefox/19..nightly","chrome/4..7","chrome/24..canary","opera/10..next","safari/4..latest","iphone/6","ipad/6"]},"contributors":[{"name":"Jason Smith Work","email":"jhs@iriscouch.com"},{"name":"Jason Smith","email":"jason.h.smith@gmail.com"},{"name":"maxogden","email":"max@maxogden.com"}],"bugs":{"url":"https://github.com/iriscouch/browser-request/issues"},"_id":"browser-request@0.3.2","_shasum":"d2e574dccc2ea88de03a2be378b533576fd99620","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"jhs","email":"jason.h.smith@gmail.com"},"maintainers":[{"name":"jhs","email":"jhs@iriscouch.com"},{"name":"maxogden","email":"max@maxogden.com"}],"dist":{"shasum":"d2e574dccc2ea88de03a2be378b533576fd99620","tarball":"https://registry.npmjs.org/browser-request/-/browser-request-0.3.2.tgz","integrity":"sha512-Tvkb27WCQx9dXnlRtOkt3s19tUGdumgqMagZWiX9mH2m0Lm0YazOhXza8jyo74P5q56inpx/0KZqbSzEoIAtHw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDGeNwepGXygKXvOLcrsLXvmeKgBubySbk6gZOqHtCPDAIgCGx0lvemPBIV+6xUSKwpjmILRSigDl8TBUao8KqndMA="}]}},"0.3.3":{"name":"browser-request","version":"0.3.3","author":{"name":"Jason Smith","email":"jhs@iriscouch.com"},"description":"Browser port of the Node.js 'request' package","keywords":["request","http","browser","browserify"],"homepage":"http://github.com/iriscouch/browser-request","repository":{"type":"git","url":"git://github.com/iriscouch/browser-request"},"scripts":{"test":"beefy test.js"},"devDependencies":{"tape":"~1.0.4","beefy":"~0.4.0","browserify":"~2.25.0"},"engines":["node"],"testling":{"files":"test.js","browsers":["ie/6..latest","firefox/3..5","firefox/19..nightly","chrome/4..7","chrome/24..canary","opera/10..next","safari/4..latest","iphone/6","ipad/6"]},"contributors":[{"name":"Jason Smith Work","email":"jhs@iriscouch.com"},{"name":"Jason Smith","email":"jason.h.smith@gmail.com"},{"name":"maxogden","email":"max@maxogden.com"},{"name":"Abbey Sparrow via Google","email":"abbeys@google.com"}],"bugs":{"url":"https://github.com/iriscouch/browser-request/issues"},"_id":"browser-request@0.3.3","dist":{"shasum":"9ece5b5aca89a29932242e18bf933def9876cc17","tarball":"https://registry.npmjs.org/browser-request/-/browser-request-0.3.3.tgz","integrity":"sha512-YyNI4qJJ+piQG6MMEuo7J3Bzaqssufx04zpEKYfSrl/1Op59HWali9zMtBpXnkmqMcOuWJPZvudrm9wISmnCbg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBrb7UxhyMkU4wOaC8D9SFR7jqLaWiPQYvs8vN9sNYF+AiBrYntwIJHipSCFBI2h5GhU4QDPlpywkdTqATs6SmrXpw=="}]},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"jhs","email":"jhs@iriscouch.com"},"maintainers":[{"name":"jhs","email":"jhs@iriscouch.com"},{"name":"maxogden","email":"max@maxogden.com"}]}},"readme":"# Browser Request: The easiest HTTP library you'll ever see\n\nBrowser Request is a port of Mikeal Rogers's ubiquitous and excellent [request][req] package to the browser.\n\nJealous of Node.js? Pining for clever callbacks? Request is for you.\n\nDon't care about Node.js? Looking for less tedium and a no-nonsense API? Request is for you too.\n\n[![browser support](https://ci.testling.com/iriscouch/browser-request.png)](https://ci.testling.com/maxogden/browser-request)\n\n# Examples\n\nFetch a resource:\n\n```javascript\nrequest('/some/resource.txt', function(er, response, body) {\n  if(er)\n    throw er;\n  console.log(\"I got: \" + body);\n})\n```\n\nSend a resource:\n\n```javascript\nrequest.put({uri:'/some/resource.xml', body:'<foo><bar/></foo>'}, function(er, response) {\n  if(er)\n    throw new Error(\"XML PUT failed (\" + er + \"): HTTP status was \" + response.status);\n  console.log(\"Stored the XML\");\n})\n```\n\nTo work with JSON, set `options.json` to `true`. Request will set the `Content-Type` and `Accept` headers, and handle parsing and serialization.\n\n```javascript\nrequest({method:'POST', url:'/db', body:'{\"relaxed\":true}', json:true}, on_response)\n\nfunction on_response(er, response, body) {\n  if(er)\n    throw er\n  if(result.ok)\n    console.log('Server ok, id = ' + result.id)\n}\n```\n\nOr, use this shorthand version (pass data into the `json` option directly):\n\n```javascript\nrequest({method:'POST', url:'/db', json:{relaxed:true}}, on_response)\n```\n\n## Convenient CouchDB\n\nBrowser Request provides a CouchDB wrapper. It is the same as the JSON wrapper, however it will indicate an error if the HTTP query was fine, but there was a problem at the database level. The most common example is `409 Conflict`.\n\n```javascript\nrequest.couch({method:'PUT', url:'/db/existing_doc', body:{\"will_conflict\":\"you bet!\"}}, function(er, resp, result) {\n  if(er.error === 'conflict')\n    return console.error(\"Couch said no: \" + er.reason); // Output: Couch said no: Document update conflict.\n\n  if(er)\n    throw er;\n\n  console.log(\"Existing doc stored. This must have been the first run.\");\n})\n```\n\nSee the [Node.js Request README][req] for several more examples. Request intends to maintain feature parity with Node request (except what the browser disallows). If you find a discrepancy, please submit a bug report. Thanks!\n\n# Usage\n\n## Browserify\n\nBrowser Request is a [browserify][browserify]-enabled package.\n\nFirst, add `browser-request` to your Node project\n\n    $ npm install browser-request\n\nNext, make a module that uses the package.\n\n```javascript\n// example.js - Example front-end (client-side) code using browser-request via browserify\n//\nvar request = require('browser-request')\nrequest('/', function(er, res) {\n  if(!er)\n    return console.log('browser-request got your root path:\\n' + res.body)\n\n  console.log('There was an error, but at least browser-request loaded and ran!')\n  throw er\n})\n```\n\nTo build this for the browser, run it through browserify.\n\n    $ browserify --entry example.js --outfile example-built.js\n\nDeploy `example-built.js` to your web site and use it from your page.\n\n```html\n  <script src=\"example-built.js\"></script> <!-- Runs the request, outputs the result to the console -->\n```\n\n## UMD\n\n`browser-request` is [UMD](https://github.com/umdjs/umd) wrapped, allowing you to serve it directly to the browser from wherever you store the module.\n\n```html\n  <script src=\"/node_modules/browser-request/index.js\"></script> <!-- Assigns the module to window.request -->\n```\n\nYou may also use an [AMD loader](http://requirejs.org/docs/whyamd.html) by referencing the same file in your loader [config](http://requirejs.org/docs/api.html#config).\n    \n## License\n\nBrowser Request is licensed under the Apache 2.0 license.\n\n","maintainers":[{"name":"jhs","email":"jhs@iriscouch.com"},{"name":"maxogden","email":"max@maxogden.com"}],"time":{"modified":"2022-06-13T05:09:46.237Z","created":"2011-12-21T16:05:20.203Z","0.1.0-beta1":"2011-12-21T16:05:28.968Z","0.1.0-beta2":"2011-12-21T16:26:29.624Z","0.1.0":"2011-12-29T08:08:00.535Z","0.2.0":"2012-03-30T06:16:19.613Z","0.2.1":"2013-02-07T07:09:03.326Z","0.3.0":"2013-10-11T02:26:27.409Z","0.3.1":"2013-10-11T02:29:46.258Z","0.3.2":"2014-07-16T07:01:30.474Z","0.3.3":"2014-11-24T09:03:27.924Z"},"author":{"name":"Jason Smith","email":"jhs@iriscouch.com"},"repository":{"type":"git","url":"git://github.com/iriscouch/browser-request"},"users":{"zeke":true,"garthk":true,"gregoryteach":true,"filipedeschamps":true,"skozz":true,"ruchirgodura":true,"incendiary":true,"martianyi":true,"pandao":true,"nonstopcoder":true,"abuddington":true,"kingjulian":true,"nilz3ro":true,"philipjc":true,"hiztmine":true},"homepage":"http://github.com/iriscouch/browser-request","keywords":["request","http","browser","browserify"],"contributors":[{"name":"Jason Smith Work","email":"jhs@iriscouch.com"},{"name":"Jason Smith","email":"jason.h.smith@gmail.com"},{"name":"maxogden","email":"max@maxogden.com"},{"name":"Abbey Sparrow via Google","email":"abbeys@google.com"}],"bugs":{"url":"https://github.com/iriscouch/browser-request/issues"},"readmeFilename":"README.md"}