fastlife.domain.model.response
¶
Module Contents¶
Classes¶
A redirect response for Post/Redirect/Get pattern. |
API¶
- class fastlife.domain.model.response.RedirectResponse(url: str | starlette.datastructures.URL, hx_redirect: bool = False, status_code: int = 303, headers: collections.abc.Mapping[str, str] | None = None, background: starlette.background.BackgroundTask | None = None)¶
Bases:
starlette.responses.Response
A redirect response for Post/Redirect/Get pattern.
The starlette default value status code is 307, which means that it is used as a way to replay the same query which is definitly not the most used case in web applications.
This is why the redirect response here is using 303 see other which ensure a GET request will be made for the redirection.
A new parameter hx_redirect exists in order to set the HX-Redirect header to follow a browser redirection from an ajax query.
Initialization