Error 415 when posting to /login

A place for developers to advertise their enabled app and get help from other developers with the API.
Forum rules
This forum is now read-only. Support for is now available at
Posts: 1
Joined: Fri Oct 05, 2018 12:50 pm

Fri Oct 05, 2018 12: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 8:02 am

Mon May 13, 2019 8:04 am

Did you figure this out? I'm stuck with the exact same problem in vscode.
User avatar
Site Admin
Posts: 2298
Joined: Fri Nov 03, 2006 2:23 pm

Tue May 14, 2019 3:28 pm

Can you include a header for "Accept: application/json" and see if that works?
Posts: 1
Joined: Thu May 16, 2019 4:12 pm

Thu May 16, 2019 4:13 pm

I have tried adding an accept header and it still doesn't work.
Posts: 1
Joined: Mon Jun 17, 2019 12:18 pm

Mon Jun 17, 2019 12: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?