Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

how to Upload a download artifact using node fetch

onemen
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 29, 2024

i am confuse about the field

 

`

const formData = new FormData();
  formData.append("files", readStream);
  const body = formData;
  const headers = new Headers({
    Authorization: `Bearer ${access_token}`,
    "Content-Type": `multipart/form-data; boundary=${formData.getBoundary()}`,
  });

  fetch(url, {
    method: "POST",
    body,
    headers,
  })

`

i get:

`Response: 400 Bad Request
{"type": "error", "error": {"message": "files: This field is required.", "fields": {"files": ["This field is required."]}}}`

what is the proper Formdata ?

 

0 answers

Suggest an answer

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

Atlassian Community Events