request/request-debug is tracked by TopGit as an open-source project, with 141 stars on GitHub, written primarily in JavaScript. Library to monitor HTTP(S) requests made with mikeal/request.
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
This Node.js module provides an easy way to monitor HTTP(S) requests performed
by the request module, and their
responses from external servers.
Usage
Basic usage is to require the module and call it, passing in the object
returned by require('request'):
var request = require('request');
require('request-debug')(request);
This will set up event handlers on every request performed with the request
variable from this point.
You can also specify a function to handle request or response data:
require('request-debug')(request, function(type, data, r) {
// put your request or response handling logic here
});
If you specify your own handling function, r will be the Request instance
that generated the event, and type will be one of the following values:
request - Headers were sent to the server and will be included as
data.headers. data.body may also be present for POST requests.
response - Headers were received from the server and will be included as
data.headers. Note that request only buffers the response body if a
callback was given, so it will only be available as data.body if the
initial call to request included a callback.
redirect - A redirect status code (HTTP 3xx) was received. The data
object will have properties statusCode, headers, and uri (the address
of the next request).
auth - A HTTP 401 Unathorized response was received. Internally,
request handles this like a redirect, so the same properties will be
available on the data object.
You can use the data.debugId parameter to match up requests with their
responses and other events.
The default handling function writes the data to stderr in Node's JSON-like
object display format. See the example below for more details.
To disable debugging, call request.stopDebugging() (this function only exists
if debugging has already been enabled). Any requests that are in progress when
stopDebugging() is called will still generate debug events.
Example
var request = require('request');
require('request-debug')(request);
// digest.php is example 2 from:
// http://php.net/manual/en/features.http-auth.php
request({
uri : 'http://nylen.tv/digest.php',
auth : {
user : 'admin',
pass : 'mypass',
sendImmediately : false
},
rejectUnauthorized : false,
}, function(err, res, body) {
console.log('REQUEST RESULTS:', err, res.statusCode, body);
});
Unless you provide your own function as the second parameter to the
request-debug call, this will produce console output similar to the
following:
TopGit's last sync did not record any GitHub topics for request/request-debug. GitHub topics appear in the right sidebar of a repository page; that's the authoritative place to check.
How active is development on request/request-debug?
The most recent commit recorded on request/request-debug was 6.8 years ago, based on the GitHub push timestamp. The repository has 19 forks — one of the better signals of community interest.
How many stars does request/request-debug have?
request/request-debug has 141 GitHub stars — refresh the page for the live number, or check github.com/request/request-debug. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
What language is request/request-debug written in?
request/request-debug is written primarily in JavaScript. GitHub's language field is based on the largest share of bytes in the default branch.
Where do I read more about request/request-debug?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/request/request-debug is the definitive source.
Read full README in the tab above.
Still deciding about request-debug?
One click hands the question to an AI along with this page — see what it says about request-debug.