diff --git a/docs/api.md b/docs/api.md index d01cc649ba..a55ea777fc 100644 --- a/docs/api.md +++ b/docs/api.md @@ -70,7 +70,7 @@ * The amount of time elapsed between sending the request and calling `close()` on the corresponding response received for that request. [total_seconds()](https://docs.python.org/3/library/datetime.html#datetime.timedelta.total_seconds) to correctly get the total elapsed seconds. -* `def .raise_for_status()` - **Response** +* `def .raise_for_status()` - **Self** * `def .json()` - **Any** * `def .read()` - **bytes** * `def .iter_raw([chunk_size])` - **bytes iterator** diff --git a/httpx/_models.py b/httpx/_models.py index 67d74bf86b..c365208968 100644 --- a/httpx/_models.py +++ b/httpx/_models.py @@ -791,7 +791,7 @@ def has_redirect_location(self) -> bool: and "Location" in self.headers ) - def raise_for_status(self) -> Response: + def raise_for_status(self) -> typing.Self: """ Raise the `HTTPStatusError` if one occurred. """