Redirect
class¶
esmerald.datastructures.redirect.Redirect
¶
Bases: ResponseContainer[RedirectResponse]
path
instance-attribute
¶
path
The url path to redirect.
This should be in format of /<str>
.
Example: /redirect-page
.
status_code
class-attribute
instance-attribute
¶
status_code = HTTP_307_TEMPORARY_REDIRECT
The status code of the response.
This should be in format of int
.
Example: 301
.
to_response
¶
to_response(headers, media_type, status_code, app)
PARAMETER | DESCRIPTION |
---|---|
headers
|
TYPE:
|
media_type
|
TYPE:
|
status_code
|
TYPE:
|
app
|
TYPE:
|
Source code in esmerald/datastructures/redirect.py
38 39 40 41 42 43 44 45 46 47 48 49 50 |
|