Good day,
I'm facing this error code using axios.get. The error code is 415. What I want to do is, supply const object to send it to my controller. I tried to debug the controller but it doesn't proceed in my controller (ASP.NET Core Controller).
Here are my sample codes:
// Class that I want to supply
public class User{
public int? Name {get;set;}
public DateTime? Bday {get;set;}
}
// My Controller
public async Task<IActionResult> GetUsers([FromBody] User user){
// Do something here
}
// My js file axios is already imported and working
async searchUser(){
const user = {
Name: name,
Bday: bday
}
await axios.get(`/SomePage/GetUsers/`,user).then(response=>{
// do something here
}.catch(error=>{console.log(error);});
}
I hope someone will help me find a solution about this.