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 redirect the client to |
| code | int = 303 | The HTTP status code for the redirect, defaulting to 303 (See Other) |
| Response | `type[BaseResponse] | None` = None |
Returns
| Type | Description |
|---|---|
BaseResponse | A response object that triggers a browser redirection to the specified location |