Node/Express - res.status().send() only sends the status but does not send an object
The body
of the response that comes back from fetch()
is a ReadableStream
. You need to process it to turn it into something usable. Normally you would call response.json()
to parse it as a JSON object:
fetch("http://localhost:3000/users/accounts/", { method: "post", headers: { Accept: "application/json", "Content-Type": "application/json" }, body: JSON.stringify(userData)}) .then(response => response.json()) .then(response => console.log(response));}