I'm trying to upload a zip file to a Confluence page with a axios.post and I'm getting "Unsupported Media Type" error. I'm following the instructions from Atlassian Development REST API documentation. Does anyone know why I'm having this issue? Any help is appreciated, thanks! This is my code:
axios.post('http://example.com/rest/api/content/1234/child/attachment
', {
file: "filepath/namefile.zip",
comment: "comment to file"
}, {
headers: {
"X-Atlassian-Token": "no-check",
"Content-Type": "application/zip",
},
auth: { username: "user@user", password: "passwordToken" }
})
.then(res => {
console.log(res)
})
.catch(error => {
console.error(error)
})