UPDATE. My colleague helped to solve this problem. For unknown reason the methods need to have Get in front of the method name. Although I also added explicit attribute HTTPGet just in case.
Hi everybody,
I'm getting the following error and I could not figure out what may be wrong. Here is the error in the console:
http://localhost:9753/SiriuswareControl/api/maxKeysOnServer/forceRefreshAll 405 (Method Not Allowed)
Here is the code - the top one works fine, the bottom produces that error - I don't see the difference and don't understand the error:
[Route("GetMaxKeysOnServer")]
public IHttpActionResult GetMaxKeysOnServer()
{
var maxKeysOnServer = _maxKeyTablesAdapter.GetMaxkeysOnServer();
return Ok(maxKeysOnServer);
}
[Route("forceRefreshAll")]
public IHttpActionResult ForceRefreshAll()
{
int nextKey = _maxKeyTablesAdapter.SetNextLastModValue("RefreshALL");
return Ok(nextKey);
}
Also, this code is not being even hit, so the error happens before that.
Thanks a lot in advance.
If it's not broken, fix it until it is.
My Blog