HTTP 405 — Method Not Allowed
HTTP 405 means the URL exists but the HTTP verb is wrong for it — POSTing to a read-only resource, or DELETE against an endpoint that only supports GET. An Allow header lists the verbs that would work.
When 405 shows up
- Clients calling the right path with the wrong method.
- Read-only public mirrors receiving write attempts.
Mocking a 405 response
A response with this status can be faked end to end with a local mock rule — no backend changes needed. The configuration below mirrors the rule fields the ApiSimul editor uses (method, path, status, delay in milliseconds, response body):
{
"method": "GET",
"path": "/api/users",
"status": 405,
"delay": 170,
"enabled": true,
"body": null
}Dynamic placeholders such as {{random.name}}, {{string.uuid}} or {{number.int 1 100}} can appear inside the body to vary each response, which keeps client-side list rendering and retry logic honest during development.
Frequently asked questions
What does HTTP 405 mean?
The resource is real but does not accept this method. The Allow response header names the supported set; switching verbs may fix the request.
How can I test a 405 response without a real backend?
Define a mock rule with the method and path your client requests and set the status to 405. The example configuration above returns this response after the listed delay, so the client exercises its 405 handling exactly as it would against a live server.
Related status codes
Need the response in your own project? Spin up rules for any status with the ApiSimul mock server, or browse every status code page.