Skip to content

About

Library to monitor HTTP(S) requests made with mikeal/request.

Resources

Stars

141 stars

Watchers

12 watching

Forks

Latest commit

 

History

46 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

request-debug Build status npm package

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.