In my React app when I submit a form to create a new user I create a request to the server using fetch
.
The code is this one:
fetch('http://0.0.0.0:3000/users', {
method: 'POST',
mode: 'no-cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
}).then(response => console.log(response))
When I check the entry in the Network tab under the Developer Tools I see that the Content-Type is text/plain
but I do not understand why if I set it as application/json
.
I have tried using the option Edit and send
in the request and replace text/plain
to application/json
but after sending it it is sent as text/plain
.