redirect
Create a redirect response object.
def redirect(
location: str,
code: int = 303,
Response: type[BaseResponse] | None = None
) - > BaseResponse
Create a redirect response object. If :data:~flask.current_app is available, it will use its :meth:~flask.Flask.redirect method, otherwise it will use :func:werkzeug.utils.redirect.
Parameters
| Name | Type | Description |
|---|---|---|
| location | str | The target URL or path to which the client should be redirected |
| code | int = 303 | The HTTP status code used for the redirect, typically 303, 302, or 301 |
| Response | `type[BaseResponse] | None` = None |
Returns
| Type | Description |
|---|---|
BaseResponse | A response object that triggers a browser redirection to the specified location |