diff --git a/docs/migration/flask.rst b/docs/migration/flask.rst index a043fc4001..cbdc0038b2 100644 --- a/docs/migration/flask.rst +++ b/docs/migration/flask.rst @@ -445,7 +445,7 @@ For redirects, instead of ``redirect`` use ``Redirect``: @get("/hello") def hello() -> Redirect: - return Redirect(url="index") + return Redirect(path="index") app = Litestar([index, hello]) diff --git a/docs/usage/middleware/creating-middleware.rst b/docs/usage/middleware/creating-middleware.rst index 321f5effd7..29104d238e 100644 --- a/docs/usage/middleware/creating-middleware.rst +++ b/docs/usage/middleware/creating-middleware.rst @@ -110,7 +110,7 @@ explore another example - redirecting the request to a different url from a midd async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if Request(scope).session is None: - response = Redirect(url="/login") + response = Redirect(path="/login") await response(scope, receive, send) else: await self.app(scope, receive, send) diff --git a/docs/usage/responses.rst b/docs/usage/responses.rst index d8199e66bc..9c9d7b8729 100644 --- a/docs/usage/responses.rst +++ b/docs/usage/responses.rst @@ -585,7 +585,7 @@ In Litestar, a redirect response looks like this: # do some stuff here # ... # finally return redirect - return Redirect(url="/other-path") + return Redirect(path="/other-path") To return a redirect response you should do the following: diff --git a/docs/usage/routing/handlers.rst b/docs/usage/routing/handlers.rst index 3f43e1bc58..53a7e961c0 100644 --- a/docs/usage/routing/handlers.rst +++ b/docs/usage/routing/handlers.rst @@ -425,13 +425,13 @@ it can be used to build a URL path for that handler: # do something with the handler index below, e.g. send a redirect response to the handler, or access # handler.opt and some values stored there etc. - return Redirect(url=handler_index[0]) + return Redirect(path=handler_index[0]) @get("/redirect/{param_value:int}", name="five") def handler_five(request: Request, param_value: int) -> Redirect: path = request.app.route_reverse("three", param=param_value) - return Redirect(url=path) + return Redirect(path=path) app = Litestar(route_handlers=[handler_one, handler_two, handler_three])