{"_id":"request-debug","_rev":"19-24dc5ab8da28d17929b5d23d91758efa","name":"request-debug","description":"Library to assist with debugging HTTP(s) requests made by the request module.","dist-tags":{"latest":"0.2.0"},"versions":{"0.0.1":{"name":"request-debug","author":{"name":"James Nylen","email":"jnylen@gmail.com"},"description":"Library to assist with debugging HTTP(s) requests made by the request module.","version":"0.0.1","repository":{"type":"git","url":"https://github.com/nylen/request-debug"},"bugs":{"url":"https://github.com/nylen/request-debug/issues"},"license":"MIT","keywords":["request","debug","http","https","headers"],"scripts":{"test":"node node_modules/.bin/mocha"},"main":"index.js","devDependencies":{"express":"~4.8.6","mocha":"~1.21.4","passport":"~0.2.0","passport-http":"~0.2.2","request":"~2.40.0","should":"~4.0.4"},"dependencies":{"clone":"~0.1.18"},"gitHead":"730e8a268fd70ef7f6bdc5575d3f584697ab1ea4","homepage":"https://github.com/nylen/request-debug","_id":"request-debug@0.0.1","_shasum":"755a6db5e85440f25ee6dbf282cf89fdb1236b52","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"nylen","email":"jnylen@gmail.com"},"maintainers":[{"name":"nylen","email":"jnylen@gmail.com"}],"dist":{"shasum":"755a6db5e85440f25ee6dbf282cf89fdb1236b52","tarball":"https://registry.npmjs.org/request-debug/-/request-debug-0.0.1.tgz","integrity":"sha512-CiWC0I3Gd8siJpKmkChPmj1TTxMUhDJU9E20RoWairMHnytevI80AcbRpgcUS+iPypNcI8Q5Jk4sj7kXMuMtcw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCVxBfeKSoqgKGirH9FpFrJIJwbengcwAQMtL/jbqowowIhAIJ6uDsGrkd00uqHIIBmGSgfPMIFAOgzRtad4AgBWkxb"}]}},"0.0.2":{"name":"request-debug","author":{"name":"James Nylen","email":"jnylen@gmail.com"},"description":"Library to assist with debugging HTTP(s) requests made by the request module.","version":"0.0.2","repository":{"type":"git","url":"https://github.com/nylen/request-debug"},"bugs":{"url":"https://github.com/nylen/request-debug/issues"},"license":"MIT","keywords":["request","debug","http","https","headers"],"scripts":{"test":"node node_modules/.bin/mocha"},"main":"index.js","devDependencies":{"express":"~4.8.6","mocha":"~1.21.4","passport":"~0.2.0","passport-http":"~0.2.2","request":"~2.40.0","should":"~4.0.4"},"dependencies":{"clone":"~0.1.18"},"gitHead":"bd2093d85ea196a0172ad5eca48f728328628d06","homepage":"https://github.com/nylen/request-debug","_id":"request-debug@0.0.2","_shasum":"be7607810342399a89952b021e2523afbc2a7b84","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"nylen","email":"jnylen@gmail.com"},"maintainers":[{"name":"nylen","email":"jnylen@gmail.com"}],"dist":{"shasum":"be7607810342399a89952b021e2523afbc2a7b84","tarball":"https://registry.npmjs.org/request-debug/-/request-debug-0.0.2.tgz","integrity":"sha512-CFjJ65UPzC1oAGQL6m2kVxGdJtWUlO/lwBsIuV3A4giF4cmFickE74ZM+WQN8h4pXyORaR9RE3xDxk1SC7eK1w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCK/jsvi3Vsmm+A72AZIKh5S08CLYmhNg2BzyG7JKKjoQIgV5DgoRwwBHGXZL91w5Vaa4uQs0rb2Cq4p7fojLUqRZg="}]}},"0.0.3":{"name":"request-debug","author":{"name":"James Nylen","email":"jnylen@gmail.com"},"description":"Library to assist with debugging HTTP(s) requests made by the request module.","version":"0.0.3","repository":{"type":"git","url":"https://github.com/nylen/request-debug"},"bugs":{"url":"https://github.com/nylen/request-debug/issues"},"license":"MIT","keywords":["request","debug","http","https","headers"],"scripts":{"test":"node node_modules/.bin/mocha"},"main":"index.js","devDependencies":{"express":"~4.8.6","mocha":"~1.21.4","passport":"~0.2.0","passport-http":"~0.2.2","request":"~2.40.0","should":"~4.0.4"},"dependencies":{"clone":"~0.1.18"},"gitHead":"a5bb307e70dd756b8ae12287aa54cd9bea486948","homepage":"https://github.com/nylen/request-debug","_id":"request-debug@0.0.3","_shasum":"7bd16e57d3e5aea114759d56e06d3f51ef68e850","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"nylen","email":"jnylen@gmail.com"},"maintainers":[{"name":"nylen","email":"jnylen@gmail.com"}],"dist":{"shasum":"7bd16e57d3e5aea114759d56e06d3f51ef68e850","tarball":"https://registry.npmjs.org/request-debug/-/request-debug-0.0.3.tgz","integrity":"sha512-la6/QjUtv3iyFhWgNFLa5KW5lso73uazV/h+bh6Gj63WYyu5jYkh21mFldUX4usCI40EunmqCmxAvNPrs72kGg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHMGlI8u6PZ976VvjpmUvRxH8fHx2jXOZcWG5Xz4lw/KAiEAxeXKXelB6r9/hAcqm//Occdwamrf78hOmCYI6j/xtx8="}]}},"0.1.0":{"name":"request-debug","author":{"name":"James Nylen","email":"jnylen@gmail.com"},"description":"Library to assist with debugging HTTP(s) requests made by the request module.","version":"0.1.0","repository":{"type":"git","url":"https://github.com/nylen/request-debug"},"bugs":{"url":"https://github.com/nylen/request-debug/issues"},"license":"MIT","keywords":["request","debug","http","https","headers"],"scripts":{"test":"node node_modules/.bin/mocha"},"main":"index.js","devDependencies":{"express":"~4.8.6","mocha":"~1.21.4","passport":"~0.2.0","passport-http":"~0.2.2","request":"~2.40.0","should":"~4.0.4"},"dependencies":{"clone":"~0.1.18"},"gitHead":"052bec744c1b117ed55c56c83fc83e996744b93d","homepage":"https://github.com/nylen/request-debug","_id":"request-debug@0.1.0","_shasum":"6e228d6f9fa4a554ef162f885e761e29b11dd86f","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"nylen","email":"jnylen@gmail.com"},"maintainers":[{"name":"nylen","email":"jnylen@gmail.com"}],"dist":{"shasum":"6e228d6f9fa4a554ef162f885e761e29b11dd86f","tarball":"https://registry.npmjs.org/request-debug/-/request-debug-0.1.0.tgz","integrity":"sha512-xGzpNyaj7v5Bakiej02TnBDeAfW3VNYwmW5b+CHis938locza7xSKnW8pnQqKTaplr+gGtjX/cBdOwtp+Wjv8w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCpsSontk7xabeCJVQWROrjPftnguYg0Ij4YqGTpC2O5wIhALYqVcYeqFmmk3pBYrZvymCSd0+Ca2VmYOeac7AVkIVs"}]}},"0.1.1":{"name":"request-debug","author":{"name":"James Nylen","email":"jnylen@gmail.com"},"description":"Library to assist with debugging HTTP(s) requests made by the request module.","version":"0.1.1","repository":{"type":"git","url":"https://github.com/request/request-debug"},"bugs":{"url":"https://github.com/request/request-debug/issues"},"license":"MIT","keywords":["request","debug","http","https","headers"],"scripts":{"test":"node node_modules/.bin/mocha"},"main":"index.js","devDependencies":{"express":"~4.8.6","mocha":"~1.21.4","passport":"~0.2.0","passport-http":"~0.2.2","request":"~2.40.0","should":"~4.0.4"},"dependencies":{"clone":"~0.1.18"},"gitHead":"e0df2334946e4deef541a8e39d4158a4c3c5f023","homepage":"https://github.com/request/request-debug","_id":"request-debug@0.1.1","_shasum":"95b1c763c9752a90ebd887285c5c6911d05d27d8","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"nylen","email":"jnylen@gmail.com"},"maintainers":[{"name":"nylen","email":"jnylen@gmail.com"}],"dist":{"shasum":"95b1c763c9752a90ebd887285c5c6911d05d27d8","tarball":"https://registry.npmjs.org/request-debug/-/request-debug-0.1.1.tgz","integrity":"sha512-YsHqEDEPMSoEv4oyyzpAgKYqLtVZUn771wDRcosYhoc6uPf8f5y7KgR/y3e5LiZK04qRZquegsdIaOlRfBKI8A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAZAfTgxI8NC+oC9FZr0+E/Fe5EWfg2KSS7yv3Yqw9KtAiEA/6lUtCwcxkor/SwOwSEhUqkeU9NlYhyhcnHr4LKglsY="}]}},"0.2.0":{"name":"request-debug","author":{"name":"James Nylen","email":"jnylen@gmail.com"},"description":"Library to assist with debugging HTTP(s) requests made by the request module.","version":"0.2.0","repository":{"type":"git","url":"https://github.com/request/request-debug"},"bugs":{"url":"https://github.com/request/request-debug/issues"},"license":"MIT","keywords":["request","debug","http","https","headers"],"scripts":{"test":"node node_modules/.bin/mocha"},"main":"index.js","devDependencies":{"detect-engine":"~1.0.2","express":"~4.8.6","mocha":"~1.21.4","passport":"~0.2.0","passport-http":"~0.2.2","request":"~2.50.0","should":"~4.0.4"},"dependencies":{"stringify-clone":"^1.0.0"},"gitHead":"afd2d830582ee6d86a7d14b3490e0a2eb80068da","homepage":"https://github.com/request/request-debug","_id":"request-debug@0.2.0","_shasum":"fc054ec817181b04ca41a052c136f61c48abaf78","_from":".","_npmVersion":"2.7.4","_nodeVersion":"0.12.2","_npmUser":{"name":"simov","email":"simeonvelichkov@gmail.com"},"maintainers":[{"name":"nylen","email":"jnylen@gmail.com"},{"name":"simov","email":"simeonvelichkov@gmail.com"}],"dist":{"shasum":"fc054ec817181b04ca41a052c136f61c48abaf78","tarball":"https://registry.npmjs.org/request-debug/-/request-debug-0.2.0.tgz","integrity":"sha512-NWYi/Gz4xKSkK1oPAsLLjMkSbp4aaW77fxPGe7uoKg1bgN7qXKVI5S/Cm/cubTKD62yJd7eKQLdlQ9QRLhgvvA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCeY6UHYCZkdyeQEitVesOb8F+wQbrtRM26k4rUJA/s0AIhAJA9dZZiW9OpnDVuecsKX3nEc41nCem88G742tBCRksY"}]}}},"readme":"# request-debug [![Build status](https://img.shields.io/travis/request/request-debug.svg?style=flat)](https://travis-ci.org/request/request-debug) [![npm package](http://img.shields.io/npm/v/request-debug.svg?style=flat)](https://www.npmjs.org/package/request-debug)\n\nThis Node.js module provides an easy way to monitor HTTP(S) requests performed\nby the [`request` module](https://github.com/request/request), and their\nresponses from external servers.\n\n## Usage\n\nBasic usage is to require the module and call it, passing in the object\nreturned by `require('request')`:\n\n```js\nvar request = require('request');\n\nrequire('request-debug')(request);\n```\n\nThis will set up event handlers on every request performed with the `request`\nvariable from this point.\n\nYou can also specify a function to handle request or response data:\n\n```js\nrequire('request-debug')(request, function(type, data, r) {\n    // put your request or response handling logic here\n});\n```\n\nIf you specify your own handling function, `r` will be the `Request` instance\nthat generated the event, and `type` will be one of the following values:\n\n- **request** - Headers were sent to the server and will be included as\n  `data.headers`.  `data.body` may also be present for POST requests.\n\n- **response** - Headers were received from the server and will be included as\n  `data.headers`.  Note that `request` only buffers the response body if a\n  callback was given, so it will only be available as `data.body` if the\n  initial call to `request` included a callback.\n\n- **redirect** - A redirect status code (*HTTP 3xx*) was received.  The `data`\n  object will have properties `statusCode`, `headers`, and `uri` (the address\n  of the next request).\n\n- **auth** - A *HTTP 401 Unathorized* response was received.  Internally,\n  `request` handles this like a redirect, so the same properties will be\n  available on the `data` object.\n\nYou can use the `data.debugId` parameter to match up requests with their\nresponses and other events.\n\nThe default handling function writes the data to *stderr* in Node's JSON-like\nobject display format.  See the example below for more details.\n\nTo disable debugging, call `request.stopDebugging()` (this function only exists\nif debugging has already been enabled).  Any requests that are in progress when\n`stopDebugging()` is called will still generate debug events.\n\n## Example\n\n```js\nvar request = require('request');\n\nrequire('request-debug')(request);\n\n// digest.php is example 2 from:\n// http://php.net/manual/en/features.http-auth.php\n\nrequest({\n    uri  : 'http://nylen.tv/digest.php',\n    auth : {\n        user : 'admin',\n        pass : 'mypass',\n        sendImmediately : false\n    },\n    rejectUnauthorized : false,\n}, function(err, res, body) {\n    console.log('REQUEST RESULTS:', err, res.statusCode, body);\n});\n```\n\nUnless you provide your own function as the second parameter to the\n`request-debug` call, this will produce console output similar to the\nfollowing:\n\n```js\n{ request:\n   { debugId: 1,\n     uri: 'http://nylen.tv/digest.php',\n     method: 'GET',\n     headers: { host: 'nylen.tv' } } }\n{ auth:\n   { debugId: 1,\n     statusCode: 401,\n     headers:\n      { date: 'Mon, 20 Oct 2014 03:34:58 GMT',\n        server: 'Apache/2.4.6 (Debian)',\n        'x-powered-by': 'PHP/5.5.6-1',\n        'www-authenticate': 'Digest realm=\"Restricted area\",qop=\"auth\",nonce=\"544482e2556d9\",opaque=\"cdce8a5c95a1427d74df7acbf41c9ce0\"',\n        'content-length': '39',\n        'keep-alive': 'timeout=5, max=100',\n        connection: 'Keep-Alive',\n        'content-type': 'text/html' },\n     uri: 'http://nylen.tv/digest.php' } }\n{ request:\n   { debugId: 1,\n     uri: 'http://nylen.tv/digest.php',\n     method: 'GET',\n     headers:\n      { authorization: 'Digest username=\"admin\", realm=\"Restricted area\", nonce=\"544482e2556d9\", uri=\"/digest.php\", qop=auth, response=\"e833c7fa52e8d42fae3ca784b96dfd38\", nc=00000001, cnonce=\"ab6ff3dd95a0449e990a6c8465a6bb26\", opaque=\"cdce8a5c95a1427d74df7acbf41c9ce0\"',\n        host: 'nylen.tv' } } }\n{ response:\n   { debugId: 1,\n     headers:\n      { date: 'Mon, 20 Oct 2014 03:34:58 GMT',\n        server: 'Apache/2.4.6 (Debian)',\n        'x-powered-by': 'PHP/5.5.6-1',\n        'content-length': '27',\n        'keep-alive': 'timeout=5, max=100',\n        connection: 'Keep-Alive',\n        'content-type': 'text/html' },\n     statusCode: 200,\n     body: 'You are logged in as: admin' } }\nREQUEST RESULTS: null 200 You are logged in as: admin\n```\n\n## Compatibility\n\nTested with Node.js versions 0.8.x, 0.10.x, and 0.11.x on Travis, and a bunch\nof different `request` versions.\n\nDoes not work with `request` versions older than 2.22.0 (July 2013).  Tests\ndon't start passing until version 2.28.0 (December 2013).\n","maintainers":[{"name":"nylen","email":"jnylen@gmail.com"},{"name":"simov","email":"simeonvelichkov@gmail.com"}],"time":{"modified":"2022-06-26T11:30:11.528Z","created":"2014-08-29T03:42:11.091Z","0.0.1":"2014-08-29T03:42:11.091Z","0.0.2":"2014-09-14T20:34:07.773Z","0.0.3":"2014-09-15T14:58:36.844Z","0.1.0":"2014-10-20T04:02:03.979Z","0.1.1":"2014-10-26T21:03:19.718Z","0.2.0":"2015-05-20T17:57:17.448Z"},"homepage":"https://github.com/request/request-debug","keywords":["request","debug","http","https","headers"],"repository":{"type":"git","url":"https://github.com/request/request-debug"},"author":{"name":"James Nylen","email":"jnylen@gmail.com"},"bugs":{"url":"https://github.com/request/request-debug/issues"},"license":"MIT","readmeFilename":"README.md","users":{"cguillemette":true,"wangnan0610":true,"gurunate":true,"vchouhan":true}}