I trying to post to a api with accepts an integer parameter using angular as below
function getDailyErrors() {
var uri = "/api/users/error-counts/";
var inData = { numberOfDays : 5}
return $http.post(uri, inData)
.then(function (response) {
return response.data;
});
}
API
[HttpPost]
[Route("api/users/error-counts/")]
public MultiCategorySeriesDto<int> GetErrorCounts(int numberOfDays=15)
{
return _uow.Events.Errors(numberOfDays);
}
for some reasons the API doesn't accept the parameter I passed instead takes the default int parameter. May I know where the mistake is?