| 202 | |
| 203 | |
| 204 | class RedirectResponse(Response): |
| 205 | def __init__( |
| 206 | self, |
| 207 | url: str | URL, |
| 208 | status_code: int = 307, |
| 209 | headers: Mapping[str, str] | None = None, |
| 210 | background: BackgroundTask | None = None, |
| 211 | ) -> None: |
| 212 | super().__init__(content=b"", status_code=status_code, headers=headers, background=background) |
| 213 | self.headers["location"] = quote(str(url), safe=":/%#?=@[]!$&'()*+,;") |
| 214 | |
| 215 | |
| 216 | Content = str | bytes | memoryview |
no outgoing calls