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: 'application/json; charset=utf-8',
async: true,
...
});
I can't call api in project, please help me
how to resold problem