如何查看节点soap中的请求和响应数据? [英] How to see request and response data in node soap?
问题描述
我正在尝试使用节点肥皂来使用肥皂API。我的响应无法解析,我想知道如何在控制台中查看请求和响应数据以简化错误查找过程。
I am trying to consume a soap api using node soap. My response cannot be parsed and I wonder how to see the request and response data to console to ease the error finding process.
推荐答案
当节点soap使用请求库时,可以通过以下方式对其进行调试:
As node soap uses the request library, one can debug it via:
NODE_DEBUG=request node src/index.js
如请求的Readme.md :
调试
Debugging
至少有三种方法来调试 request
的操作:
There are at least three ways to debug the operation of request
:
-
启动像
NODE_DEBUG = request node script.js
这样的节点进程(lib,request,otherlib
也可以)。
Launch the node process like
NODE_DEBUG=request node script.js
(lib,request,otherlib
works too).
随时设置 require('request')。debug = true
(此操作相同就像#1)。
Set require('request').debug = true
at any time (this does the same thing as #1).
使用请求调试模块以查看请求
以及响应标头和正文。
Use the request-debug module to view request and response headers and bodies.
这篇关于如何查看节点soap中的请求和响应数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!