405 Method Not Allowed
I am receiving a 405 error, with no other relevant log messages. Any ideas what's happening?
Accessor
IPermitClient
PermitClient
AddPermit (Frontend code where the PermitClient is called with data)
MockPermits.PermitList
Didn't include the controller, because this error happens before the controller is even reached
4 Replies
From the error it sounds like whatever endpoint you're trying to hit doesn't support whatever http method you're sending.
This suggests you're sending a POST, but does that endpoint actually support a POST? Or if it does, does the
PostAsJsonAsync
method actually send it as a POST?show the controller
the problem is most likely that you didn't give it the right
[HttpX]
attribute, thus there is no route matching your request
so its not entering the action you want it to, because there is no matching routeand the request mantches that route?
ie, has the route inherited from the controller and is a POST request?