如何为此节点请求模块启用详细日志?

Som*_*ath 23 request node.js

如何为以下节点请求模块启用详细日志?

https://github.com/mikeal/request

 var reqParam = {
            'headers': {
                'User-Agent': 'CLA'
            },
            'body': 'CSCCDDSADADDADADADAAAEE', 
            'strictSSL': true,
            'jar': false,
            'encoding': null,
            'timeout': 300000
        };

  request.post(reqParam, function (err, res, body) {               
        if (err) {
           console.log('Curl request received an error:' + err);  
        }
    console.log(body);
  };
Run Code Online (Sandbox Code Playgroud)

有什么选项可以为https://github.com/mikeal/request模块启用http VERBOSE日志?

cyb*_*bat 33

你的意思是调试?

NODE_DEBUG=request node yourscript.js
Run Code Online (Sandbox Code Playgroud)

  • 从文档:随时设置`require('request').debug = true`;) (31认同)