exception documentation
class MethodNotAllowed(HTTPException): (source)
*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 |
Get a list of headers. |
Class Variable | code |
Undocumented |
Class Variable | description |
Undocumented |
Instance Variable | valid |
Undocumented |
Inherited from HTTPException
:
Method | __call__ |
Call the exception as WSGI application. |
Method | __repr__ |
Undocumented |
Method | __str__ |
Undocumented |
Method | get |
Get the HTML body. |
Method | get |
Get the description. |
Method | get |
Get a response object. If one was passed to the exception it's returned directly. |
Instance Variable | response |
Undocumented |
Property | name |
The status name. |
def __init__(self, valid_methods:
t.Optional[ t.Iterable[ str]]
= None, description: t.Optional[ str]
= None, response: t.Optional[ Response]
= None):
(source)
¶
Takes an optional list of valid http methods starting with werkzeug 0.3 the list will be mandatory.