The HTTP Error 405, or “Method Not Allowed” error, can be a frustrating experience for both website visitors and website owners. This common web error occurs when a request method is not supported for the requested resource. As a result, visitors may be unable to access certain parts of a website, which can negatively impact the user experience.
Table of Contents
- What is the Error 405 Method Not Allowed?
- Different 405 error messages
- How to fix the Error 405
- All HTTP Status Codes
What is the Error 405 Method Not Allowed?
The HTTP error code 405, “Method Not Allowed” indicates that the server is aware of the requested page or resource, but does not authorize the method used to request it.
Let’s remember, this is an error within the 4xx group, so the error occurs on the client side, that is, our browser or web application. For instance, when we interact with a web page with our browser.
However, it is difficult to attribute this type of error to a simple navigation through a web page. It is more likely to encounter the 405 error when working with web applications where we carry out transactions with data.
To accurately understand the meaning of this “405 Method Not Allowed” error, it is necessary to know the HTTP protocol call methods used on the Internet.
The meaning of HTTP Request Methods
The HTTP, Hypertext Transfer Protocol, defines a series of methods to indicate the intention of the actions that are carried out when communicating with a web server. In other words, the request method indicate the desired action to be performed for a given request.
It is common to refer to the HTTP Request Methods as “Verbs”
e.g. When you press “enter” in your web browser, to go to a website, you are using the Verb “GET” to perform the request.
The 9 HTTP Request Methods
The RFC currently defines nine HTTP Request Methods:
Method Name | Description |
---|---|
GET | Transfer a current representation of the target resource. This method is used to retrieve information from the given server using a given URI. Requests using GET should only retrieve data and should have no other effect on the data. |
HEAD | Same as GET, but do not transfer the response content. This methods give us all the information embed in the Headers section without carrying the content. |
POST | Perform resource-specific processing on the request content. A POST request is used to send new data to the server, for example, registration form, login form, file upload, … |
PUT | Replace all current representations of the target resource with the request content. A distinction from POST is that the client specifies the target location on the server. |
DELETE | Remove all current representations of the target resource. |
CONNECT | Establish a tunnel to the server identified by the target resource. It is often used to secure connections through TLS servers. |
OPTIONS | Describe the communication options for the target resource. This method is usually used to send a request to the server so that in the response it describes what other methods the provided URL supports. |
TRACE | Perform a message loop-back test along the path to the target resource. This method allows the client to see what is being received at the server end of the request chain. |
PATCH | This method applies partial modifications to a resource. The PATCH method is faster and less resource-consuming than the PUT method when making partial changes to a specified resource. |
What are the two most common HTTP request methods?
From the above list of nine Request Methods, the most common used Methods are GET and POST.
These two verbs are enough for most of the interactions we carry out while browsing the Internet. However, the proliferation of “SPA” Single Page Application, has allowed the proliferation of API data exchange, expanding the use of other HTTP methods.
How do you check if the request is GET or POST?
You can identify the Verb used in a request inspecting the HTTP Headers. If your client is a desktop browser, you can use the Developer Tools it provides to inspect the HTTP Method of each request. These are the steps:
To open the “Developer Tools” in a Chromium based browser (i.e. Chrome), select:
- “Top Menu→View→Developer→Developer Tools” or
- “⌥+⌘+I” on Mac or
- “F12+Ctrl+Shift+I” on Windows or
- You can also open it from the top right “Three dot menu”:
On the top bar of the “Developer Tools” window you’ll find the tabs of each section. Click over the “Network” tab:
Now, if the “Method” column is not shown in the requests list, then right click in the Headers bar and enable it:
The Network section will show the complete list of requests and each verb it has used.
Different 405 error messages
This error is primarily displayed as 405 Method Not Allowed
. However, depending on the web server or browser, the error message can be different:
- “405 Not Allowed”
- “(405) Method Not Allowed”
- “HTTP 405”
- “Method Not Allowed”
- “HTTP 405 Method Not Allowed”
- “HTTP Error 405 – Method Not Allowed”
- “This page isn’t working. If the problem continues, contact the site owner. HTTP ERROR 405”
The following sections show you the causes, and how to fix the error:
How to fix the Error 405
We help you identify the different causes and how to fix it on each case.
Fixing the 405 Error as an end user of an App or Web site
If you are using an App or browsing a site and this error appears:
1. Double check your browser URL
Before going any further, double-check to ensure that you’ve entered the URL of the site you wish to visit correctly.
2. Fix any software version incompatibility between “frontend” and “backend”
If previous fix is not your solution, most probable cause is the lack of coordination between the versioning of the “frontend” user application and the “backend” server-side application.
Your browser’s cache or cookies could cause in this case the 405 error
.
TIP: You can test in an incognito browser tab to check if browser cookies or cached info is the cause to your
405 Method Not Allowed
error.If your incognito session works, then your browser cache or cookies are the problem.
To fix the error, remove all session data, cookies, and cache data from the domain of the visited page. And reload the App or browser page.
Fixing the 405 Error while developing or managing a web site
If you are managing or building a site with WordPress:
Roll back any recent WordPress update
If you updated your WordPress Core, Theme or Plugins, the new code could be the root of the problem. First of all, if by disabling all your plugins, the HTTP Error disappears, then your 405 error is caused by a WordPress Plugin.
To find the plugin causing the problem, we recommend following this process:
- Disable all your plugins.
- Check the page that gives you the 405 HTTP Error.
- If page Works, then enable one plugin from the disabled list and jump to previous steep 2.
- If your page request Fails, then this last enabled plugin could be the one causing the HTTP 405 Error. Your next step, in this case, is to investigate. Verify if the plugin is updated to its last version and/or investigate if the plugin’s support page has any ticket related to this 405 HTTP error.
Do not break your production site!
To clone a WordPress site with Wetopi is as easy as a simple click.
Staging environments are the solution!
If you are working in a script or piece of code that interacts with an API or external service:
Double check the backend or API service manual
Double check the backend service endpoints:
- Verify the allowed connection requests this backend service provides (ask to the provider or inspect the service Reference Manual), and
- Pay special attention to the “verb” allowed for your problematic request.
- Verify both sides, your frontend and backend, are using the same HTTP request method. Remember you can use your browser to inspect the request method.
None of the solutions help to solve the Error 405 Method Not Allowed?
We hope not, but if this is your case, this may indicate that a more complex problem has occurred. Try to find help from an experienced developer. If you are a Wetopi customer, open a chat and talk with our developers’ team, we are here to help you.
Don’t you have an account on Wetopi?
Free full performance servers for your development and test.
No credit card required.
All HTTP Status Codes
200 OK
201 Created
202 Accepted
203 Non-Authoritative Information
204 No Content
205 Reset Content
206 Partial Content
207 Multi-Status
208 Already Reported
226 IM Used
300 Multiple Choices
301 Moved Permanently
302 Found
303 See Other
304 Not Modified
305 Use Proxy
307 Temporary Redirect
308 Permanent Redirect
402 Payment Required
404 Not Found
406 Not Acceptable
407 Proxy Authentication Required
408 Request Timeout
409 Conflict
411 Length Required
412 Precondition Failed
413 Payload Too Large
414 Request-URI Too Long
415 Unsupported Media Type
416 Requested Range Not Satisfiable
417 Expectation Failed
418 I’m A Teapot
421 Misdirected Request
422 Unprocessable Entity
423 Locked
424 Failed Dependency
426 Upgrade Required
428 Precondition Required
429 Too Many Requests
431 Request Header Fields Too Large
444 Connection Closed Without Response
451 Unavailable For Legal Reasons
501 Not Implemented
505 HTTP Version Not Supported
506 Variant Also Negotiates
507 Insufficient Storage
508 Loop Detected
510 Not Extended
511 Network Authentication Required
599 Network Connect Timeout Error