Skip to content

Commit

Permalink
Feat: add httpx helpful methods on Response
Browse files Browse the repository at this point in the history
  • Loading branch information
iyume committed Dec 18, 2024
1 parent 1931f67 commit 95aeee9
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions githubkit/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,33 @@ def _status_reason(self) -> str:
else str(self.status_code)
)

@property
def is_informational(self) -> bool:
return self._response.is_informational

@property
def is_success(self) -> bool:
return self._response.is_success

@property
def is_redirect(self) -> bool:
return self._response.is_redirect

@property
def is_client_error(self) -> bool:
return self._response.is_client_error

@property
def is_server_error(self) -> bool:
return self._response.is_server_error

@property
def is_error(self) -> bool:
return self._response.is_error

def raise_for_status(self) -> None:
self._response.raise_for_status()

@property
def headers(self) -> httpx.Headers:
return self._response.headers
Expand Down

0 comments on commit 95aeee9

Please sign in to comment.