class MethodNotAllowed(HTTPException):
405 Method Not Allowed
Raise if the server used a method the resource does not handle. For
example POST
if the resource is view only. Especially useful for REST.
The first argument for this exception should be a list of allowed methods. Strictly speaking the response would be invalid if you don't provide valid methods in the header which you can do with that list.
Method | __init__ |
Takes an optional list of valid http methods starting with werkzeug 0.3 the list will be mandatory. |
Method | get_headers |
Get a list of headers. |
Class Variable | code |
Undocumented |
Class Variable | description |
Undocumented |
Instance Variable | valid_methods |
Undocumented |
Inherited from HTTPException
:
Class Method | wrap |
Create an exception that is a subclass of the calling HTTP exception and the exception argument. |
Method | __call__ |
Call the exception as WSGI application. |
Method | __repr__ |
Undocumented |
Method | __str__ |
Undocumented |
Method | get_body |
Get the HTML body. |
Method | get_description |
Get the description. |
Method | get_response |
Get a response object. If one was passed to the exception it's returned directly. |
Instance Variable | response |
Undocumented |
Property | name |
The status name. |
Parameters | |
valid_methods:t.Optional[ | Undocumented |
description:t.Optional[ | Undocumented |
response:t.Optional[ | Undocumented |