I'm encountering an issue where my AJAX call isn't reaching the controller method in my ASP.NET Core application. Despite setting up the AJAX call and controller method, I'm receiving a 404 error. Here's my controller method and JavaScript function:
[HttpPost]
public async Task<ActionResult> GetCityConfigurations(DSParamsDto dSParams)
{
// Your controller logic here
var citys = await cityService.Getcitys(dataTableParams);
return Json(new JqueyDataTableResponseModel<cityDto>
{
draw = dataTableParams.Draw,
recordsTotal = citys.Total,
recordsFiltered = citys.Total,
data = citys.Items
});
}
function GetcitySapConfigurations() {
var token = $('input[name="__RequestVerificationToken"]').val();
citySapConfig = $("#tblcitySapConfiguration").DataTable({
"processing": true,
"serverSide": true,
"ajax": {
"url": 'GetCityConfigurations/',
"type": "POST",
"datatype": "json",
"headers": { "XSRF-TOKEN": token },
"error": handleAjaxErrorLoc
},
"columns": [
{
"data": "cityId"
},
{ "data": "cityName" }
]
});
}
I've confirmed that the URL in the AJAX call ('GetCityConfigurations/') is correct, and I've included the necessary anti-forgery token. However, the request doesn't seem to reach the controller action. Any insights into what might be causing this issue would be greatly appreciated. Thank you!

404 Not Foundmy guess is that the client-side code requests a URL that the ASP.NET code base doesn't recognize. Feel free to update the question once you have more information to share.