0
An error in JavaScript fetch api
Uncaught (in promise) Type Error: failed to execute 'fetch' on window : invalid name
2 Answers
+ 2
Please link your code otherwise it's impossible to find mistake
0
fetch("http://localhost:3000/signup", {
method: "POST",
body: JSON.stringify(item),
headers: { 'Content/Type': 'application/json' },
})
.then((Response) => Response.json())
.then((Result) => {
if (Result.message == "Operation Successful")
this.props.history.push("/login");
else alert("Sorrrrrry !!!! Un-authenticated User !!!!!");
});
I have the same error here is my code above