Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira rest api return 200 status code with empty body

naseriimahmoud
Contributor
September 5, 2021

Hi,

I tried to upload attachment with restApi, jiraRequest return 200 status code bot body is empty array

const form = new FormData();
form.append('file', blob, 'test.webm');

const responseFile = await requestJira('/rest/api/3/issue/'+issueKey+'/attachments', {
method:'POST',
body: form,
headers:{
'Accept': 'application/json',
'X-Atlassian-Token': 'no-check',
'Content-Type':'multipart/form-data; boundary=----WebKitFormBoundaryzU2OoKU9kzQe3Mb8',
'user-agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0',
'Cookie': 'atlassian.xsrf.token=0b01400c-2e53-42f4-9300-87b2d5189d6f_cc52a869d11568dfbbf747343a6caaa32ca3c7dc_lin'
}
});
console.log(`Response: ${responseFile.status} ${responseFile.statusText}`);
let res = await responseFile.json();
console.log(res)

 

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events