i want to force the content-type to application/json but i have a mode "no-cors" and actually the return for content-type is : text/plain;charset=UTF-8 its the same when i pass the headers so i don't know how do this.
I have already tried to use fetch or Axios, the URL is in HTTP and i work in local so maybe it's the problem? I have tried on Postman, that work great.
fetch('http://link', {
method: 'POST',
credentials: 'include',
redirect: 'follow',
mode: 'no-cors',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"cluster_id" : [],
"surname" :["albert"],
"gender" :[],
}),
}).then((result) => {
this.setState({ allClient: result.data }, () => {
this.setState({ load: true })
console.log(this.state.allClient)
})
So, i want to have content type: application/json and not Content-Type: text/plain;charset=UTF-8