Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions impit-python/python/impit/impit.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,17 @@ class Response:
print(data) # Parsed JSON data as a Python object (dict, list, etc.)
"""

def raise_for_status(self) -> None:
"""Raise an :class:`HTTPStatusError` exception if the response status code indicates an error (4xx or 5xx).

Does nothing for successful status codes.

.. code-block:: python

response = await client.get("https://api.example.com/data")
response.raise_for_status() # Raises if status is 4xx or 5xx
"""

def close(self) -> None:
"""Close the response and release resources.

Expand Down
Loading