Running into a bad request 400 error when using axios call to endpoint ending in .php.
Code for the call looks like this
const API = {
userLogin: function () {
const email = "test@email";
const password = "Test1234";
return axios({
method: "POST",
body: {
email,
password,
},
headers: {
"Content-Type": "application/json",
},
url: "url ends in /user-login.php",
});
},
};
the email and password are different in my actual code as are is the URL, but they were giving to me as body params to pass to the endpoint. The instructions state to make the API call method "POST" and pass email and password as body params.
here is the error response i get in the picture included.
the top error is with using Fetch, and the Error that is expanded is with that axios call above. Any suggestions?