开发者

Response to DELETE method request sent using node.js never arrives

I have node.js server which acts like a proxy. It recieves localhost requests and forward them to web service on another domain. GET, POST and PUT requests work just fine. But I have a problem with DELETE method request. 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. Moreover, if I send the same request using Fiddler for example, I receive an actual response.

Here is how my node.js http.request options look like:

{
  "host": "some.domain",
  "port": 443,
  "path": "/paht/item/id",
  "method": "DELETE",
  "headers": {
    "Host": "some.domain",
    "Content-Type": "application/json; charset=utf-8"
  }
}


smthin to do with firewall/spyware setting (check routers firewall) I had the same thing where my app worked on one pc and not on another...


Answering to my own question:
Nodejs adds Transfer-Encoding: chunked header to such DELETE request. And this header was causing described problem.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜