tool::http-status-detail
405 Method Not Allowed
The HTTP method is not supported for this resource.
Status Code
405
Name
Method Not Allowed
Category
4xxDetailed Explanation
HTTP 405 Method Not Allowed indicates that the HTTP method used in the request is not supported for the target resource. For example, sending a POST to a GET-only endpoint triggers this response. The server must include an Allow header listing the permitted methods.
Common Causes
- ▸Sending POST, PUT, or DELETE to a read-only API endpoint
- ▸Sending a PUT or DELETE request to a static file server
- ▸A route handler that does not implement the requested method
- ▸Attempting a CORS preflight with a non-OPTIONS method
How to Fix
- 1.Check the Allow header to see which methods are permitted
- 2.Review API documentation for the supported methods for that endpoint
- 3.Check the server router configuration for allowed methods on that path
- 4.Use the appropriate REST method: GET for reads, POST for creates, etc.
Related HTTP Headers
AllowContent-TypeResponse Example
HTTP/1.1 405 Method Not Allowed
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
{"error":"method_not_allowed","message":"POST method is not supported for this endpoint"}Related Status Codes
400Bad RequestThe server could not understand the request due to invalid syntax.→401UnauthorizedAuthentication is required and has failed or not been provided.→402Payment RequiredReserved for future use; some services use it for payment walls.→403ForbiddenThe server refuses to fulfill the request (authenticated but unauthorized).→404Not FoundThe requested resource could not be found.→
ad · 300×250
// related tools