I'am sending content type as Text/csv as my API accept only the text/csv type but the file's content type is showing as application/vnd.ms-excel.
I've also checked with the postman, API is accepting the file in the http request but when I'am sending through my browser application it returns the response unsupported media type
How can I solve this.
Please go through the code:
var Authorization=window.sessionStorage.getItem('acesstToken')
var Headers={
'Authorization': 'Bearer '+Authorization,
'Content-Type': 'text/csv',
}
const fd = new FormData()
fd.append('csv_file',fieldValues.file[0],fieldValues.file[0].name);
var url="XXXXXXXXXXXXXXX";
fetch(url,{
method : 'POST',
headers: Headers,
body: fd,
})