exception documentation
class RequestRedirect(HTTPException, RoutingException): (source)
Raise if the map requests a redirect. This is for example the case if `strict_slashes` are activated and an url that requires a trailing slash. The attribute `new_url` contains the absolute destination url.
Method | __init__ |
Undocumented |
Method | get |
Get a response object. If one was passed to the exception it's returned directly. |
Class Variable | code |
Undocumented |
Instance Variable | new |
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 list of headers. |
Instance Variable | description |
Undocumented |
Instance Variable | response |
Undocumented |
Property | name |
The status name. |
def get_response(self, environ:
t.Optional[ t.Union[ WSGIEnvironment, Request]]
= None, scope: t.Optional[ dict]
= None) -> Response
:
(source)
¶
Get a response object. If one was passed to the exception it's returned directly. :param environ: the optional environ for the request. This can be used to modify the response depending on how the request looked like. :return: a :class:`Response` object or a subclass thereof.