Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

275
Views
POST getting 415 (Unsupported Media Type) while POSTMAN returns 200

Seems like a simple issue but everywhere else suggested adding "application/json" in 'headers' which I have tried.

'Accept'and 'Content-Type' are both "application/json". Also tried both json and stringfy 'Body' but keep getting 415 on Chrome extension JavaScript.

textArraySample = ["sample","sample2"];
var serverUrl = "https://webappcontentnotification.azurewebsites.net/api/ContentUpload";
const body={
    "textbatch":textArraySample,
    "userId": userId,
    "url": window.location.href
}
let result = 
fetch(serverUrl, {
    method: 'POST',
    mode: "no-cors",
    headers: {
        'Accept': "application/json",
        'Content-Type': "application/json"
    },
    body: JSON.stringify(body)
    })
.then(response => {
    console.log('response:', response);
})
.catch((error) => {
    console.log('Error:', error);
});

Update: seems like "Content-Type" is not correctly set enter image description here

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Did not see this mentioned somewhere else. The root cause is that "Content-Type" cannot be set to "application/json" while using "Mode: no-cors". link here

mode: "no-cors" only allows a limited set of headers in the request:

Accept

Accept-Language

Content-Language

Content-Type with a value of application/x-www-form-urlencoded, multipart/form-data, or text/plain

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!