[英]Response to DELETE method request sent using node.js never arrives
I have node.js server which acts like a proxy. 我有充当代理的node.js服务器。 It recieves localhost requests and forward them to web service on another domain. 它接收localhost请求并将它们转发到另一个域上的Web服务。 GET, POST and PUT requests work just fine. GET,POST和PUT请求工作正常。 But I have a problem with DELETE method request. 但是我对DELETE方法请求有问题。 It causing "Gateway Timeout - In read" error. 它导致“网关超时-读中”错误。 But web service on another domain recieves this request and executes appropriate DB sql to delete requested item. 但是另一个域上的Web服务接收到此请求,并执行适当的DB sql删除请求的项目。 Moreover, if I send the same request using Fiddler for example, I receive an actual response. 此外,例如,如果我使用Fiddler发送相同的请求,则会收到实际的响应。
Here is how my node.js http.request options look like: 这是我的node.js http.request选项的样子:
{
"host": "some.domain",
"port": 443,
"path": "/paht/item/id",
"method": "DELETE",
"headers": {
"Host": "some.domain",
"Content-Type": "application/json; charset=utf-8"
}
}
smthin与防火墙/间谍软件设置(检查路由器防火墙)有关,我的应用与一台PC上的应用相同,而另一台PC上的应用却没有...
Answering to my own question: 回答我自己的问题:
Nodejs adds Transfer-Encoding: chunked
header to such DELETE
request. Nodejs在此类DELETE
请求中添加了Transfer-Encoding: chunked
块头。 And this header was causing described problem. 并且此标头引起了描述的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.