Skip to content

Add docstrings for response.status_code and reason #131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 22, 2023
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
6 changes: 4 additions & 2 deletions adafruit_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,10 @@ def __init__(self, sock: SocketType, session: Optional["Session"] = None) -> Non
else:
self.socket.close()
raise RuntimeError("Unable to read HTTP response.")
self.status_code = int(bytes(self._readto(b" ")))
self.reason = self._readto(b"\r\n")
self.status_code: int = int(bytes(self._readto(b" ")))
"""The status code returned by the server"""
self.reason: bytearray = self._readto(b"\r\n")
"""The status reason returned by the server"""
self._parse_headers()
self._raw = None
self._session = session
Expand Down