I have a restify server receiving a POST then it will reply with a POST call. I'm using the string client module. Below is the code:
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??
});
The POST was successful but when I tested it in REPL, it appears the process never terminates. The seems to indicate the connection is still open. Should the connection be closed in the callback?
Any pointers would be greatly appreciated. Thx.