I am trying to invoke a REST endpoint with file upload and JSON data as below;
req : {JSON}
file: <File>
My JS is as below;
formData.append("req", JSON.stringify(data));
formData.append("file", file);
axios.post(url, formData, {
headers: {
"Content-Type": `multipart/form-data`
}
})
However, I am getting 415 – Unsupported Media Type error
My Response header is as below;
accept: application/json,application/*+json
content-type: application/json
vary: Origin,Access-Control-Request-Method,Access-Control-Request-Headers,Accept-Encoding
Not sure where the issue is.
2