【问题标题】:Postman Newman - Requests that work in Postman fail in Newman with ETIMEDOUTPostman Newman - 在 Postman 中工作的请求在 Newman 中使用 ETIMEDOUT 失败
【发布时间】:2016-04-02 19:43:19
【问题描述】:

对特定服务器的所有请求都超时并出现错误 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)

测试在 Postman 和 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"/>

同样的行为发生在 Newman 的*版本和 Node 4.0+ 的 beta 版本中。 There is a bug mentioned in the newman git repo。我认为这可能与它有关,但其他请求正在处理中,所以我想确定一下。

有什么事吗?

【问题讨论】:

    标签: postman postman-collection-runner


    【解决方案1】:

    此特定行为是由 Postman 和 Newman 之间的 Content-Length 标签不同引起的。 Postman 使用大写的“Content-Length”,而 Newman 的节点包使用小写的“content-length”。我正在与之交谈的进程无法识别小写版本。

    【讨论】: