Login no working
Gw0zdziu opened this issue · 1 comments
Gw0zdziu commented
Login no working
amarphule commented
@Gw0zdziu I faced the same issue solved by adding headers in a POST request
here is my code
fetch("https://fakestoreapi.com/auth/login", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
username: "mor_2314",
password: "83r5^_",
}),
})
.then((res) => res.json())
.then((json) => console.log(json));
Hope this will help, Happy coding 😊