{"_id":"@derhuerst/http-basic","_rev":"5-366097c68fd6dd8a51f4e72cdc2e31e3","name":"@derhuerst/http-basic","dist-tags":{"latest":"8.2.4"},"versions":{"8.2.0":{"name":"@derhuerst/http-basic","version":"8.2.0","main":"lib/index.js","types":"lib/index.d.ts","description":"Very low level wrapper arround http.request/https.request","keywords":["http","https","request","fetch","gzip","deflate","redirect","cache","etag","cache-control"],"dependencies":{"caseless":"^0.12.0","concat-stream":"^1.6.2","http-response-object":"^3.0.1","parse-cache-control":"^1.0.1"},"devDependencies":{"@types/concat-stream":"^1.6.0","@types/node":"^11.9.0","flowgen2":"^2.2.1","rimraf":"^2.5.4","serve-static":"^1.11.1","typescript":"^2.3.4"},"scripts":{"prepublishOnly":"npm run build","build":"tsc && flowgen lib/**/*","pretest":"npm run build","test":"node test/index && node test/cache && node test/cache-invalidation && rimraf lib/cache"},"engines":{"node":">=6.0.0"},"repository":{"type":"git","url":"git+https://github.com/derhuerst/http-basic.git"},"author":{"name":"ForbesLindesay"},"license":"MIT","gitHead":"8dc3f53ef6a4815728ebbfc7e8559b5418725bad","bugs":{"url":"https://github.com/derhuerst/http-basic/issues"},"homepage":"https://github.com/derhuerst/http-basic#readme","_id":"@derhuerst/http-basic@8.2.0","_nodeVersion":"12.16.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-v1cqPUpFjU8DInW4YkC9caGKy8kUkqz0z10yCHawkxgpaJPId0F5xKi8fUY5rqC58F9Muz9T136jNReZQH9xIw==","shasum":"d009a4a6820dea756061d21842e79d1dbf9a1e11","tarball":"https://registry.npmjs.org/@derhuerst/http-basic/-/http-basic-8.2.0.tgz","fileCount":44,"unpackedSize":49447,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeilzLCRA9TVsSAnZWagAA3UsQAJRtRhwnlTm7J6+ZbU0E\ntuy1RS47xaScNwWDWKujE2ADl7T1vPWuyGHW9gNaDuxxya0G3x9donunlgHY\n1mMz5jLQK1GBtIOGJWTqQWYfkQ0tvoYsw8W+CyQMLpHjER3wVVdyaKbSVAyE\nbjuChFvZ9QdkAWymhr+g4PLBPRCT6loz3sKotJAchGaud2+uepU2/1K1qmj7\n/hq2MyH8kckIIsFpSvqU31OnWjzJqI7rtCZzs15eD/BUQ7wa1Q6BQ5ga6zUS\nO8T+JqD+JFS+uBoAm6eo1dxMAQz9hrApsKl+VWf6yfyerhyFSjnUiv5fibi+\nhxfFE4u/3uNzYhhZC6lRXNAqPR1ChARxrTvme+Rdf1fYZsWLiTlICkLL/2/x\n2bRPvEBBZHWm+u7sazJ9bUOiiedpV6yhYreksBvnGRvLC4IxMDRXytKKJ0EO\nAYWAPpnVw/gZKp1/WuNdk+Izk+RILkIh4P7QwA1YYVd5YbuZ1Hbn/MGNiFex\nlV32Z6Xj2hp8onC2rd3EyiMBkHEg4JoGuPVeH14ZN17eFtwO1q/hF7PY+mK8\nWIf//79VCKc8CiSN4zduIC6i6fhaHptG385XFRTtBxVMqp/96qKp8ECxZu+D\necrImQSRmT6jM+Mfb7+1/P9fAGbhqpfdSVTwvFOXYOlzcoAmrmkZImAA/TEK\n0KAQ\r\n=T7/b\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQTcCAyxiSljVY92wRRZyLJ11gsQiyLsP7L3gu+17/uQIhAM6ccrQRVHQyIAQMiAhknZsVl05yBIRiqvjSZpU4WDVV"}]},"maintainers":[{"name":"derhuerst","email":"mail@jannisr.de"}],"_npmUser":{"name":"derhuerst","email":"mail@jannisr.de"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-basic_8.2.0_1586126026887_0.8278847292445912"},"_hasShrinkwrap":false},"8.2.1":{"name":"@derhuerst/http-basic","version":"8.2.1","main":"lib/index.js","types":"lib/index.d.ts","description":"Very low level wrapper arround http.request/https.request","keywords":["http","https","request","fetch","gzip","deflate","redirect","cache","etag","cache-control"],"dependencies":{"caseless":"^0.12.0","concat-stream":"^1.6.2","http-response-object":"^3.0.1","parse-cache-control":"^1.0.1"},"devDependencies":{"@types/concat-stream":"^1.6.0","@types/node":"^11.9.0","flowgen2":"^2.2.1","rimraf":"^2.5.4","serve-static":"^1.11.1","typescript":"^2.3.4"},"scripts":{"build":"tsc && flowgen lib/**/*","pretest":"npm run build","test":"node test/index && node test/cache && node test/cache-invalidation && rimraf lib/cache"},"engines":{"node":">=6.0.0"},"repository":{"type":"git","url":"git+https://github.com/ForbesLindesay/http-basic.git"},"author":{"name":"ForbesLindesay"},"license":"MIT","gitHead":"646836d87592192c52df121c3a3c253e84171c0b","bugs":{"url":"https://github.com/ForbesLindesay/http-basic/issues"},"homepage":"https://github.com/ForbesLindesay/http-basic#readme","_id":"@derhuerst/http-basic@8.2.1","_nodeVersion":"14.9.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-Rmn7qQQulw2sxJ8qGfZ7OuqMWuhz8V+L5xnYKMF5cXVcYqmgWqlVEAme90pF7Ya8OVhxVxLmhh0rI2k6t7ITWw==","shasum":"11e3964cf1f2fb40806f9a0fff0c451bb7526093","tarball":"https://registry.npmjs.org/@derhuerst/http-basic/-/http-basic-8.2.1.tgz","fileCount":25,"unpackedSize":38416,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYg/SCRA9TVsSAnZWagAAsqgP/jcLTPfsES3a0p7p9rhi\n7J6tJzsWlUg2FRe312ipYbcyf+ULyjQJMuXCsPVeAh++P+Jjloh8jLtApGG5\n7rzFsQfv67E2tX6yk+RKxbc5848+WLTZdisVC72Qx5R42YRCnndFzbtHU+aj\n8xKsaZv6uIPJMul7wlYX6Dg2uwkYa07f9WVbDVa7/58LS7pWICkCQo2g0clm\nDAlI3Y9sAa9eDVNvHzRKV3LSAiw5mskvlqKdGnlaBBgmiz2ZMYSTynWBsF10\n58T7omUauS8pcP1HcHBMKne/f8HqCn3wpaI6049tlHlDyQJ/QOecsWACL6aF\nM5Y1roFIgQp3yFDSsJ89SsED+Ps9OhPQaWLygHNXr+IUhc0ce8NRScc0Jnab\nM4nGFzP1AuMJtSUjCWrNxzMuxm1QblEjxbj68E1gdHCUyjVAWFpDI6FRl0fr\n3jtIZogxR5IFBRlNlMPN9RL6dIlZ4vkbRNFJZyRYYxBATFb9L/FmCSkHMqnO\nmIuUwLeWGDNP7Y8IUayHlzNkuKOekMnlthTtVne0ul6jHriA4JDiYUyYHeo5\nhLUoRda4YYt17Nca7txHdSaQ/sGUiu3UB8WIVsM1SPm/cq6v1Jfpr2cl4KJb\nhmeNyuGNYOLTsNTMvslSHoPp9KI4tlmu0/NTH2AF0JwBLfaDAr58UnQ3Qzz0\nYoni\r\n=52CN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBoZKUUjaEJhlDa2e62S5lRNtbXGDM42T+ofAd6Lb19DAiEAlpeC7Hdmu1AI3sDxfUNsWkZH9L+EXvT91LBIHgl1JgY="}]},"maintainers":[{"name":"derhuerst","email":"mail@jannisr.de"}],"_npmUser":{"name":"derhuerst","email":"mail@jannisr.de"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-basic_8.2.1_1600262098051_0.8818946103517626"},"_hasShrinkwrap":false},"8.2.2":{"name":"@derhuerst/http-basic","version":"8.2.2","main":"lib/index.js","types":"lib/index.d.ts","description":"Very low level wrapper arround http.request/https.request","keywords":["http","https","request","fetch","gzip","deflate","redirect","cache","etag","cache-control"],"dependencies":{"caseless":"^0.12.0","concat-stream":"^1.6.2","http-response-object":"^3.0.1","parse-cache-control":"^1.0.1"},"devDependencies":{"@types/concat-stream":"^1.6.0","@types/node":"^11.9.0","flowgen2":"^2.2.1","rimraf":"^2.5.4","serve-static":"^1.11.1","typescript":"^2.3.4"},"scripts":{"prepublishOnly":"npm run build","build":"tsc && flowgen lib/**/*","pretest":"npm run build","test":"node test/index && node test/cache && node test/cache-invalidation && rimraf lib/cache"},"engines":{"node":">=6.0.0"},"repository":{"type":"git","url":"git+https://github.com/derhuerst/http-basic.git"},"author":{"name":"ForbesLindesay"},"license":"MIT","gitHead":"a178e6a1b6c2d9f6b8c489fb08a5c0cc378bb970","bugs":{"url":"https://github.com/derhuerst/http-basic/issues"},"homepage":"https://github.com/derhuerst/http-basic#readme","_id":"@derhuerst/http-basic@8.2.2","_nodeVersion":"17.2.0","_npmVersion":"8.3.0","dist":{"integrity":"sha512-ek065nW95mleLHo8vZ+ob7QTQPNOwDEjCe27BX2flme/UTu9z2mD1uRRPko38u7al4tTZADMtozpll8PQHAZgg==","shasum":"48c88e66c4d47db3b20dd906693f897b22444a27","tarball":"https://registry.npmjs.org/@derhuerst/http-basic/-/http-basic-8.2.2.tgz","fileCount":36,"unpackedSize":44336,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh0gWKCRA9TVsSAnZWagAAtlwQAJ9+iNAHsdzpBbeGBJHL\nY+yx8MGkzXkSkQKGbok7LyZTWHyDDjogwFNF2ZOi5eUFmc7djzzyWU7a+LK8\nuCNIi5fJ1U5+mODlL4nvrqkawRFz4m4LzfU3Bo4BBeTfln4thgye7CFN6sty\ntCO8m0x5h8lRu6tFVYkg4AJEZjN23Qhg6b0CM980XbzTy/7s7XyTLd8nxWdI\nUU79kHu8ThJmOKn7YamKlNjwjufINwiaEHwjvEnpdJyBeGSJVdTDUZlN5FK/\nlN8YpDgQvzWBqUUlSR2PR/MLY8yUNMaehI00KXvxhrAAcyJ6hAVJqWFWcCtR\ncljcVmEMWEagNCDVpfSjckHRXFUK5qEI067vY1oa/zmBI0LG27UH+KQmF+er\nn5uhBjOtr/8iD55o41wq1jhALYMSii6+0QZdqRKpA7A9CkQxDP2GNzM3SswJ\nOWNit6wqOEzxGU8g2GrgcN+F4BH9N3o+Y2mzRXQlOFJtBGtkSIhM8G/sFr42\n0XH5WnQmfk0+XAn2n/sLvXlCvmrx+bBfj/pVRB00dEP1Y2qcIoCxAWt/pH5S\nWcm/2GpBlVFDi8fgHhKJgzOLI1IdMg+ciuKPrXTfe0ExTwdnROJfhftitz/U\nkqnudssg9+rK+km187B4DuhC4Voc/zfwdlSxaWf6VuWdWJ7jHatPYlxvpdKq\nTr/B\r\n=P2+d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+l8Yb/IPIUQQgO0zV3o8p1BKNmc1cquyDquIaXA21hwIgWmDHIFrRODkus0kNM8WJv1tXQGiJYF/tBCVIO9o8kjU="}]},"_npmUser":{"name":"derhuerst","email":"mail@jannisr.de"},"directories":{},"maintainers":[{"name":"derhuerst","email":"mail@jannisr.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-basic_8.2.2_1641153930709_0.6070066618499372"},"_hasShrinkwrap":false},"8.2.3":{"name":"@derhuerst/http-basic","version":"8.2.3","main":"lib/index.js","types":"lib/index.d.ts","description":"Very low level wrapper arround http.request/https.request","keywords":["http","https","request","fetch","gzip","deflate","redirect","cache","etag","cache-control"],"dependencies":{"caseless":"^0.12.0","concat-stream":"^1.6.2","http-response-object":"^3.0.1","parse-cache-control":"^1.0.1"},"devDependencies":{"@types/concat-stream":"^1.6.0","@types/node":"^17.0.6","flowgen2":"^2.2.1","rimraf":"^2.5.4","serve-static":"^1.11.1","typescript":"^4.5.4"},"scripts":{"prepublishOnly":"npm run build","build":"tsc && flowgen lib/**/*","pretest":"npm run build","test":"node test/index && node test/cache && node test/cache-invalidation && rimraf lib/cache"},"engines":{"node":">=6.0.0"},"repository":{"type":"git","url":"git+https://github.com/derhuerst/http-basic.git"},"author":{"name":"ForbesLindesay"},"license":"MIT","gitHead":"2efef654f79d84a1f594fcad67686d4df8d68e95","bugs":{"url":"https://github.com/derhuerst/http-basic/issues"},"homepage":"https://github.com/derhuerst/http-basic#readme","_id":"@derhuerst/http-basic@8.2.3","_nodeVersion":"18.4.0","_npmVersion":"8.12.1","dist":{"integrity":"sha512-tMC4jVVS6x6zBx6z9XKA12ij7zMFUVEzc9Je+xIudu4yR8FwGgU6pLKddsDX8BtQlklnvwPEOskHOwQP5f9gow==","shasum":"fbefd3db2f8f03fe59c2c7307d53ef68b42134a4","tarball":"https://registry.npmjs.org/@derhuerst/http-basic/-/http-basic-8.2.3.tgz","fileCount":36,"unpackedSize":45206,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFGuDbEQ9zp/B0WU8Xp+UGre3ExLaLj0YF5cMxyLUjmXAiEAlo/SqDYDpLCVErSelWfaPnmROTizNmGMav+DVb19BYU="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiubNPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr0aRAAiCLisOSPMwit36MlvDkgsmjG9QUr3iCTiu0NOGltIlGhOHSf\r\ny+rF44RPYk3/9vKmrFMCap+iPZiAsk5emfSoEuJCadl+9GZ3M9j3lqbDI7A0\r\nFlvxKlvg1ZBJvVSMI4RsLZPmt1wisCFmxRkb+bWdSVcudPq7PYoKrCLnOi9X\r\n+Me9jX9nYubTreAGWluDW12Zwiyp2gkUuDu9KTZ5HrOQgRQ95OifzUB0ntCA\r\nnJHjM3k90FZ2JaRvtu7FfN4C+agmKSCmN6an11p5Viq/jRNiA0RnxQJaHVYm\r\nnTL5nkiVcAHolrlP+q3SKw/r7Ip13Gh8p7gOlnNXyBUSvOo/4oGjETk8LrmK\r\nVVjxSS8kfPrbF8hoWtuN1635QzhpHAzWXgp/zwHsVIVB+O9JZm1kgikaI+/M\r\nYDYSrzaH+761pNckn8Hr4Q17fBAcGGiM7F7/d63c/DCtm3B0vZW6c94jZsBI\r\nonrbh+WUWRkXbTs3D7X7QiLOsK1r0lNZRk904S89q/8uHmn4wjZ9I0TeMsVX\r\nw659zaHwKnVhRiC9gbufeK8HZaRUWTStgLNRvw/Lt1Z19ukbPLtsHBin3L8I\r\niXbx742aEV3EhlI36n5O7rEN1npaGlnwPlTwYAx2Gc/kMfep89bxEdngWouv\r\nKMcYLj+t4tjAz+CGvBVRsRqhkd4GHJKooZE=\r\n=RuWB\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"derhuerst","email":"mail@jannisr.de"},"directories":{},"maintainers":[{"name":"derhuerst","email":"mail@jannisr.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-basic_8.2.3_1656337231283_0.1321225311517149"},"_hasShrinkwrap":false},"8.2.4":{"name":"@derhuerst/http-basic","version":"8.2.4","main":"lib/index.js","types":"lib/index.d.ts","description":"Very low level wrapper arround http.request/https.request","keywords":["http","https","request","fetch","gzip","deflate","redirect","cache","etag","cache-control"],"dependencies":{"caseless":"^0.12.0","concat-stream":"^2.0.0","http-response-object":"^3.0.1","parse-cache-control":"^1.0.1"},"devDependencies":{"@types/concat-stream":"^2.0.0","@types/node":"^18.0.1","flowgen2":"^2.2.1","rimraf":"^3.0.2","serve-static":"^1.11.1","typescript":"^4.5.4"},"scripts":{"prepublishOnly":"npm run build","build":"tsc && flowgen lib/**/*","pretest":"npm run build","test":"node test/index && node test/cache && node test/cache-invalidation && rimraf lib/cache"},"engines":{"node":">=6.0.0"},"repository":{"type":"git","url":"git+https://github.com/derhuerst/http-basic.git"},"author":{"name":"ForbesLindesay"},"license":"MIT","gitHead":"d6a3467f4d6d86c7f5eff8dd57eeff3622245ed1","bugs":{"url":"https://github.com/derhuerst/http-basic/issues"},"homepage":"https://github.com/derhuerst/http-basic#readme","_id":"@derhuerst/http-basic@8.2.4","_nodeVersion":"18.4.0","_npmVersion":"8.12.1","dist":{"integrity":"sha512-F9rL9k9Xjf5blCz8HsJRO4diy111cayL2vkY2XE4r4t3n0yPXVYy3KD3nJ1qbrSn9743UWSXH4IwuCa/HWlGFw==","shasum":"d021ebb8f65d54bea681ae6f4a8733ce89e7f59b","tarball":"https://registry.npmjs.org/@derhuerst/http-basic/-/http-basic-8.2.4.tgz","fileCount":36,"unpackedSize":45279,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCiwd3EOIt8Lt6zh+G7/Lb1jBoO9biuqSsuTnw4LvLDTgIhAK0LHCQg5V0R9SEstnq/thsYWHx1G2QXVIQ0hK4a8UVx"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiwv8qACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqvNA//TjqGkcsbHcdjTa7K6C+a2FeFoThElmxXLAmbz27s4MnugoLB\r\n7KuUAuNsYqJxNNfN/R44zndh/2b883U/IZ7D6klZoPtb9zUJfFuDmn0J2BmK\r\niHj44JvJjNADeN4t2uQuJQMS/2fxJzaouBlJmvloxAQpiJNxFGabDvwb8MMA\r\nuuZs36eTg5RNyVY/LRYp9WB6DXQF2OAltACN1eQJQ88gRhuDYqx8ZdJArq4G\r\nC9mzM1btdrJnwCVmqG7DoDRuOGzOQ0+qcOAXtb6iHaBA3vEsYpSgY9KBo9cL\r\n4JC5Xor0usOMya35ElfbrJl4BtjOJtxFVJlGorLwc9ilBF50WSyhzg2+8nIe\r\nCFbmpXxuT6oG8PBBL6BWXtEDpQqJBeDTnc1EVqsSIV56TdoquoGJZLvSIXdR\r\nxsoAdXwgf/qUeP9QipsVzU6rucQ9y/F9w8BWvKdRWvPLgHU5cZYAAQgJ1mI6\r\nYAKwnnyexGYbJFDEUqbLGTxbk2Nl3kt6qTQqNNhf0yHtFPXWaGvgG73iYA6/\r\n9pgce8k6rzWhWeml4o40vOSt3dKLAfHut64F9iPz/QwiTxiNPpXrZFQzGkKE\r\nB+yHivMaf0aEfnSH9KclAgNcauTPbM2LOZoVRZpFgZGqKiJA6207SMF4AWF3\r\nKre+pSEikIAiW3ww/BeUDWPwnkuUA2CJawA=\r\n=9+a7\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"derhuerst","email":"mail@jannisr.de"},"directories":{},"maintainers":[{"name":"derhuerst","email":"mail@jannisr.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-basic_8.2.4_1656946474168_0.5710901727380753"},"_hasShrinkwrap":false}},"time":{"created":"2020-04-05T22:33:46.664Z","8.2.0":"2020-04-05T22:33:47.085Z","modified":"2022-07-04T14:54:34.438Z","8.2.1":"2020-09-16T13:14:58.236Z","8.2.2":"2022-01-02T20:05:30.879Z","8.2.3":"2022-06-27T13:40:31.469Z","8.2.4":"2022-07-04T14:54:34.362Z"},"maintainers":[{"name":"derhuerst","email":"mail@jannisr.de"}],"description":"Very low level wrapper arround http.request/https.request","homepage":"https://github.com/derhuerst/http-basic#readme","keywords":["http","https","request","fetch","gzip","deflate","redirect","cache","etag","cache-control"],"repository":{"type":"git","url":"git+https://github.com/derhuerst/http-basic.git"},"author":{"name":"ForbesLindesay"},"bugs":{"url":"https://github.com/derhuerst/http-basic/issues"},"license":"MIT","readme":"# http-basic\n\n**This is a temporary fork of [`ForbesLindesay/http-basic`](https://github.com/ForbesLindesay/http-basic).**\n\n---\n\nSimple wrapper arround http.request/https.request\n\n[![Build Status](https://img.shields.io/travis/ForbesLindesay/http-basic/master.svg)](https://travis-ci.org/ForbesLindesay/http-basic)\n[![Dependency Status](https://img.shields.io/david/ForbesLindesay/http-basic.svg)](https://david-dm.org/ForbesLindesay/http-basic)\n[![NPM version](https://img.shields.io/npm/v/http-basic.svg)](https://www.npmjs.org/package/http-basic)\n\n## Installation\n\n    npm install http-basic\n\n## Usage\n\n```js\nvar request = require('http-basic');\n\nvar options = {followRedirects: true, gzip: true, cache: 'memory'};\n\nvar req = request('GET', 'http://example.com', options, function (err, res) {\n  if (err) throw err;\n  console.dir(res.statusCode);\n  res.body.resume();\n});\nreq.end();\n```\n\n**method:**\n\nThe http method (e.g. `GET`, `POST`, `PUT`, `DELETE` etc.)\n\n**url:**\n\nThe url as a string (e.g. `http://example.com`).  It must be fully qualified and either http or https.\n\n**options:**\n\n - `headers` - (default `{}`) http headers\n - `agent` - (default: `false`) controlls keep-alive (see http://nodejs.org/api/http.html#http_http_request_options_callback)\n - `duplex` - (default: `true` except for `GET`, `OPTIONS` and `HEAD` requests) allows you to explicitly set a body on a request that uses a method that normally would not have a body\n - `followRedirects` - (default: `false`) - if true, redirects are followed (note that this only affects the result in the callback)\n - `maxRedirects` - (default: `Infinity`) - limit the number of redirects allowed.\n - `allowRedirectHeaders` (default: `null`) - an array of headers allowed for redirects (none if `null`).\n - `gzip` (default: `false`) - automatically accept gzip and deflate encodings.  This is kept completely transparent to the user.\n - `cache` - (default: `null`) - `'memory'` or `'file'` to use the default built in caches or you can pass your own cache implementation.\n - `timeout` (default: `false`) - times out if no response is returned within the given number of milliseconds.\n - `socketTimeout` (default: `false`) - calls `req.setTimeout` internally which causes the request to timeout if no new data is seen for the given number of milliseconds.\n - `retry` (default: `false`) - retry GET requests.  Set this to `true` to retry when the request errors or returns a status code greater than or equal to 400 (can also be a function that takes `(err, req, attemptNo) => shouldRetry`)\n - `retryDelay` (default: `200`) - the delay between retries (can also be set to a function that takes `(err, res, attemptNo) => delay`)\n - `maxRetries` (default: `5`) - the number of times to retry before giving up.\n - `ignoreFailedInvalidation` (default: `false`) - whether the cache should swallow errors if there is a problem removing a cached response. Note that enabling this setting may result in incorrect, cached data being returned to the user.\n - `isMatch` - `(requestHeaders: Headers, cachedResponse: CachedResponse, defaultValue: boolean) => boolean` - override the default behaviour for testing whether a cached response matches a request.\n - `isExpired` - `(cachedResponse: CachedResponse, defaultValue: boolean) => boolean` - override the default behaviour for testing whether a cached response has expired\n - `canCache` - `(res: Response<NodeJS.ReadableStream>, defaultValue: boolean) => boolean` - override the default behaviour for testing whether a response can be cached\n\n**callback:**\n\nThe callback is called with `err` as the first argument and `res` as the second argument. `res` is an [http-response-object](https://github.com/ForbesLindesay/http-response-object).  It has the following properties:\n\n - `statusCode` - a number representing the HTTP Status Code\n - `headers` - an object representing the HTTP headers\n - `body` - a readable stream respresenting the request body.\n - `url` - the URL that was requested (in the case of redirects, this is the final url that was requested)\n\n**returns:**\n\nIf the method is `GET`, `DELETE` or `HEAD`, it returns `undefined`.\n\nOtherwise, it returns a writable stream for the body of the request.\n\n## Implementing a Cache\n\nA `Cache` is an object with three methods:\n\n - `getResponse(url, callback)` - retrieve a cached response object\n - `setResponse(url, response)` - cache a response object\n - `invalidateResponse(url, callback)` - remove a response which is no longer valid\n\nA cached response object is an object with the following properties:\n\n - `statusCode` - Number\n - `headers` - Object (key value pairs of strings)\n - `body` - Stream (a stream of binary data)\n - `requestHeaders` - Object (key value pairs of strings)\n - `requestTimestamp` - Number\n\n`getResponse` should call the callback with an optional error and either `null` or a cached response object, depending on whether the url can be found in the cache.  Only `GET`s are cached.\n\n`setResponse` should just swallow any errors it has (or resport them using `console.warn`).\n\n`invalidateResponse` should call the callback with an optional error if it is unable to invalidate a response.\n\nA cache may also define any of the methods from `lib/cache-utils.js` to override behaviour for what gets cached.  It is currently still only possible to cache \"get\" requests, although this could be changed.\n\n## License\n\n  MIT\n","readmeFilename":"README.md"}