Hi,
I am trying to save an attachment through REST API to an issue, using node.js
var options = {
hostname: 'testserver.com, port: 443,
path: '/rest/api/2/issue/SH-488/attachments',
method: 'POST',
rejectUnauthorized: false,
strictSSL: false,
headers: {
'Authorization': 'Basic ' + new Buffer("username" + ':' + "pasword").toString('base64'), 'Accept': 'multipart/form-data',
'X-Atlassian-Token': 'no-check' },
formData: { "file" : attachment }
};
var req = https.request(options, function (res) {
res.setEncoding('utf8');
res.on('data', function (body) {
console.log('Body2: ' + body);
}); });
but I am not getting any response (no response or error) , could someone help