This Node.js module provides an easy way to monitor HTTP(S) requests performed
by the request module, and their
responses from external servers.
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.