Javascript fetch API上的错误415(不支持的媒体类型)-ReactJS
我正试图向API REST发出POST请求,但在以下代码中出现以下错误(ERR_ABORTED 415(不支持的媒体类型)):Javascript fetch API上的错误415(不支持的媒体类型)-ReactJS,javascript,reactjs,fetch,Javascript,Reactjs,Fetch,我正试图向API REST发出POST请求,但在以下代码中出现以下错误(ERR_ABORTED 415(不支持的媒体类型)): handleSubmit = event => { event.preventDefault(); fetch('https://volgarest.herokuapp.com/volga-rest/shops/log-up/', { method : 'POST', body : JSON.stringify(th
handleSubmit = event => {
event.preventDefault();
fetch('https://volgarest.herokuapp.com/volga-rest/shops/log-up/', {
method : 'POST',
body : JSON.stringify(this.state),
headers: {
'Content-Type' : 'application/json',
'Accept' : 'application/json',
},
mode : 'no-cors'
})
.then(response => console.log(response))
.catch(error => console.error(error))
};