【发布时间】:2013-04-25 01:10:02
【问题描述】:
我有一个接收 POST 的 restify 服务器,然后它会回复一个 POST 调用。我正在使用字符串客户端模块。下面是代码:
var restify = require('restify');
var client = restify.createStringClient({
url: 'https://xyz.com'
});
var postdata = {
...
};
client.basicAuth('username','pass');
client.post('/somepath',postdata,
function(err, req, res, data) {
if(err) ... else { ... };
//should the close method be called here??
});
POST 是成功的,但是当我在 REPL 中对其进行测试时,该过程似乎永远不会终止。似乎表明连接仍处于打开状态。是否应该在回调中关闭连接?
任何指针将不胜感激。谢谢。
【问题讨论】: