You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a route endpoint is matched, but the method used to get to the endpoint is not matched by a specified route, the router defaults to throwing a 404 error, which is not exactly what's happening.
Potential Resolution
Instead, too be more RESTful, we should let the developer/client know that the endpoint exists through a different method by sending back a 405 "Method Not Allowed" error.
Example
That way, when defining routes, we could simply do this:
Problem
If a route endpoint is matched, but the method used to get to the endpoint is not matched by a specified route, the router defaults to throwing a 404 error, which is not exactly what's happening.
Potential Resolution
Instead, too be more RESTful, we should let the developer/client know that the endpoint exists through a different method by sending back a 405 "Method Not Allowed" error.
Example
That way, when defining routes, we could simply do this:
Without having to then do this for each route:
As you can imagine, that would get pretty dirt over time with numerous routes or multiple methods per route.
The text was updated successfully, but these errors were encountered: