i got a js request to my postgresql database, i'm trying to make a registration. I tried to send react state before that, but now i just filled it up with constant values.
It send an empty body. Body: null
. GET
request works, the problem happens only when i use POST
request
const response = await fetch("http://localhost:8080/api/user", {
method: "POST",
mode: 'no-cors',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
"username": "lpkopjp",
"email": "mimiomo@mail.ru",
"password": "12345678",
"repeat_password": "12345678"
})
})
question from:https://stackoverflow.com/questions/65643572/fetching-data-react-js