I have try this code
axios
.post("http://localhost:3010/user/login", {
headers: {
"Content-type": "application/json"
},
body: JSON.stringify({ username: "username", password: "password" })
})
.then(response => {
this.resp = response;
})
.catch(e => {
console.error(e);
});
but response it invalid login but it work in postman
What wrong with it?
in web response like this


axios.post("http://localhost:3010/user/login", { username: "username", password: "password" })and let Axios and Laravel handle the headers and JSON.Content-Typeand why are youstringifying? Pretty sure axios sends as JSON by default. I'm guessing that it thinks you are sending an actual "String" and not a JSON Object.