skip to Main Content

Can't using ajax call api in dotnet core 3.1? – Jquery

my class api: [Route("Api")] [ApiController] public class ApiUsersController : ControllerBase { [HttpPost] [Route("Users/demo")] public ActionResult demo([FromBody]model data) { return "OK"; } } my script jquery: var model = {key: "123"} $.ajax({ type: 'POST', url: 'Api/Users/demo', data: JSON.stringify(model), dataType: 'json', contentType:…

VIEW QUESTION
Back To Top
Search