HTTP 405 Method Not Allowed: What It Means and When You See It
Quick Answer
HTTP 405 Method Not Allowed means the HTTP method (GET, POST, PUT, etc.) is not allowed for the requested URL. The Allow header lists the permitted methods.
When HTTP 405 Occurs
HTTP 405 is returned when the HTTP method used is not supported for the requested URL. The response must include an Allow header listing the supported methods: Allow: GET, POST, HEAD. Common causes: sending a DELETE request to an endpoint that only accepts GET/POST, sending a PUT to a read-only endpoint, using GET instead of POST for a form submission endpoint, and calling a REST API with the wrong verb (PATCH vs PUT, POST vs GET). In Next.js App Router, API routes are defined per-method - calling with POST when only GET is defined returns 405. In Express, each route handler is method-specific - if you only define app.get("/users"), a POST /users returns 404 unless you add a catch-all.
405 vs 404 vs 501
HTTP 404 Not Found means the resource does not exist at all. HTTP 405 Method Not Allowed means the resource exists but does not support the method. HTTP 501 Not Implemented means the method is not supported by the server globally (rare). Use 405 when: the URL is valid and the resource exists, but the specific HTTP verb is not handled. Example: GET /users/123 returns the user (200). DELETE /users/123 returns 405 if deletion is not supported. If the URL does not exist at all, use 404 regardless of method.
Fixing HTTP 405 Errors
For API clients: check the API documentation for supported methods. Use the Allow header in the 405 response to see what methods are valid. Use an OPTIONS request to discover supported methods: curl -X OPTIONS https://api.example.com/users. For API developers (Express): ensure all required HTTP methods are registered. Add a catch-all method handler: app.all("/endpoint", (req, res, next) => { if (!["GET", "POST"].includes(req.method)) return res.status(405).set("Allow", "GET, POST").json({ error: "Method not allowed" }); next(); }). In Next.js, unhandled methods automatically return 405 with the correct Allow header.
Try the interactive tool
Convert any value instantly — no sign-up required
Frequently Asked Questions
Related Values
100
HTTP 100 Continue means the server has received the request headers and the client should proceed to send the request body. It is an interim response used to inform the client to continue.
101
HTTP 101 Switching Protocols indicates the server is switching to the protocol specified in the Upgrade header field. Commonly used when upgrading to WebSocket connections.
200
HTTP 200 OK is the standard success response. The request has succeeded and the server has returned the requested resource in the response body.
201
HTTP 201 Created means the request succeeded and a new resource was created as a result. The Location header typically points to the new resource URL.