← Back to status codes
HTTP Status Code
405 Method Not Allowed
Client ErrorThe request method is not allowed for the requested resource.
HTTP status code reference, response example, common causes, fixes, and related status codes.
What does HTTP 405 Method Not Allowed mean?
HTTP 405 Method Not Allowed is a status code sent by a server to indicate the result of an HTTP request.
Status codes help browsers, APIs, apps, and backend systems understand whether a request succeeded, failed, was redirected, or needs additional action.
In practice, HTTP 405 Method Not Allowed usually appears when a server responds under specific request, validation, permission, or infrastructure conditions.
Response example
HTTP/1.1 405 Method Not Allowed Allow: GET, POST
HTTP example
HTTP/1.1 405 Method Not Allowed
Relevant headers
Allow
Allow: GET, POST
Common causes
- Using POST on a GET-only endpoint
- Using DELETE on an unsupported route
How to fix it
- Use one of the allowed methods
- Check route handler configuration
Common mistakes
- Assuming the status code alone explains the full backend issue
- Ignoring related response headers that add important context
- Treating temporary errors as permanent failures
- Retrying too aggressively without checking the cause
- Debugging the frontend only when the problem is server-side
How browsers and APIs use it
Browsers, APIs, and backend services use HTTP status codes to understand the outcome of a request. Depending on the status code, an application may render content, retry a request, redirect the user, show an error, or trigger a different flow in the client or server.
Developer note
If you hit 405 in Next.js or an API framework, check whether the route handler exports the method you are trying to use.