Error 415 when posting to /login

A place for developers to advertise their enabled app and get help from other developers with the API.
Posts: 1
Joined: Fri Oct 05, 2018 2:50 pm

Error 415 when posting to /login

Postby Assyrial » Fri Oct 05, 2018 2:56 pm

Hi guys,

I'm making this side project but i'm getting this 'error 415 unsupported media type' everytime i post to I'm using fetch to post to it. My code:

let myHeaders = new Headers();

let myInit = { method: 'POST',
headers: myHeaders,
mode: 'no-cors',
body: JSON.stringify({

let myRequest = new Request('', myInit);

fetch(myRequest).then(function(response) {

Any of you had this problem or know what i'm doing wrong?

Posts: 1
Joined: Mon May 13, 2019 10:02 am

Re: Error 415 when posting to /login

Postby adrianleverseidge » Mon May 13, 2019 10:04 am

Did you figure this out? I'm stuck with the exact same problem in vscode.

Site Admin
Posts: 2150
Joined: Fri Nov 03, 2006 5:23 pm

Re: Error 415 when posting to /login

Postby szsori » Tue May 14, 2019 5:28 pm

Can you include a header for "Accept: application/json" and see if that works?

Posts: 1
Joined: Thu May 16, 2019 6:12 pm

Re: Error 415 when posting to /login

Postby Reprevise » Thu May 16, 2019 6:13 pm

I have tried adding an accept header and it still doesn't work.

Posts: 1
Joined: Mon Jun 17, 2019 2:18 pm

Re: Error 415 when posting to /login

Postby pete » Mon Jun 17, 2019 2:19 pm

You need to provide a header of Content-Type: application/json to get around this error, I can see your code includes it but is it being passed?