Closed miguki closed 4 years ago
this.Delete = function(path) {
return new Promise(function(resolve, reject) {
var r = requestDefaultParams;
path = getFullPath(path);
r['method'] = 'DELETE';
r['path'] = path;
var req = https.request(r, (res) => {
var statusCode = res.statusCode;
res.on('end', function() {
if (statusCode == 204) {
resolve(statusCode);
} else {
reject("Received error code: " + statusCode);
}
})
.on('error', function(err) {
reject("QRS response error:" + err);
});
}).on('error', function(err) {
reject("QRS request error:" + err);
});
});
};
Oops. typo when I updated the code. Clearly don't have any tests checking deletes. Will update and also add some tests. Thanks.
Also in DELETE method https response events are not fired, so promises cannot be resolved
fixed in 6.1.0
req.end();
is not called in DELETE method definition, so request is not taking place