Improve documentation
This commit is contained in:
@@ -4,12 +4,23 @@ from httplib.httpsocket import HTTPSocket, InvalidResponse
|
||||
|
||||
|
||||
class HTTPClient(HTTPSocket):
|
||||
"""
|
||||
Wrapper class for a socket. Represents a client which connects to a server.
|
||||
"""
|
||||
|
||||
host: str
|
||||
|
||||
def __init__(self, host: str):
|
||||
super().__init__(socket.socket(socket.AF_INET, socket.SOCK_STREAM), host)
|
||||
super().__init__(socket.socket(socket.AF_INET, socket.SOCK_STREAM))
|
||||
self.host = host
|
||||
|
||||
def read_line(self):
|
||||
"""
|
||||
Reads the next line decoded as `httpsocket.FORMAT`
|
||||
|
||||
@return: the decoded next line retrieved from the socket
|
||||
@raise InvalidResponse: If the next line couldn't be decoded, but was expected to
|
||||
"""
|
||||
try:
|
||||
return super().read_line()
|
||||
except UnicodeDecodeError:
|
||||
|
Reference in New Issue
Block a user