Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 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);});
- }
Add Comment
Please, Sign In to add comment