Answer the question
In order to leave comments, you need to log in
How to get outgoing traffic from request object in node js?
There is a popular package https://github.com/request/request, it's easy to set parameters and get a response. How can I get the raw data that this request sends to the server? It is clear that I know what parameters I set, but I would like it completely, in its raw form as it is, along with headers and other things.
var request = require('request');
request('http://www.google.com', function (error, response, body) {
});
Answer the question
In order to leave comments, you need to log in
1. See README
2. See in " Debugging ":
3. We look at request-debug and see in " Usage ":
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:
require('request-debug')(request, function(type, data, r) { // put your request or response handling logic here });
request - Headers were sent to the server and will be included as data.headers. data.body may also be present for POST requests.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question