Ran*_*Dan 5 postman postman-collection-runner
对特定服务器的所有请求都因错误ETIMEDOUT而超时。
[...]$ newman -c Test.json.postman_collection
Iteration 1 of 1
RequestError: [223f1c83-1bb6-b40c-acc7-d90a2dd4e4ce] 'HB Heart Beat' terminated. Complete error:
Error: ETIMEDOUT
at null._onTimeout (~/.nvm/versions/node/v0.12.9/lib/node_modules/newman/node_modules/request/request.js:808:15)
at Timer.listOnTimeout (timers.js:119:15)
Run Code Online (Sandbox Code Playgroud)
这些测试可在邮递员和Collection Runner中运行。我可以使用bash中的curl命中目标服务器。我还没有足够的经验来深入研究Newman错误,因此不胜感激。
实际的请求很简单。我删除了所有环境变量,以查看是否可以正常工作:
POST HTTP/1.1
Host: http://<IP ADDRESS GOES HERE>
Content-Length: 161
Cache-Control: no-cache
Postman-Token: 0e650324-356e-0a21-6ee1-2d7731a3f28c
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<HB timestamp="123456789" xmlns="http://google.com"/>
Run Code Online (Sandbox Code Playgroud)
在顶级版本的Newman和Beta版本的Node 4.0+中,也会发生相同的行为。 newman git repo中提到了一个错误。我认为这可能与它有关,但是其他请求正在处理中,因此我想确定一下。
有什么事吗
此特定行为是由 Postman 和 Newman 之间的内容长度标签差异引起的。Postman 使用大写的“Content-Length”,而 Newman 的节点包使用小写的“content-length”。我正在交谈的进程无法识别小写版本。