code
stringlengths
3
6.57k
self.__response.isclosed()
request. (_CS_REQ_STARTED)
point (2)
true. (_CS_REQ_SENT)
point (2)
response (effectively meaning, "there is no prior response")
CannotSendRequest(self.__state)
_contains_disallowed_url_pchar_re.search(url)
match.group()
self._output(request.encode('ascii')
HTTPConnection()
servers (such as Apache)
url.startswith('http')
urlsplit(url)
netloc.encode("ascii")
netloc.encode("idna")
self.putheader('Host', netloc_enc)
host.encode("ascii")
host.encode("idna")
host.find(':')
self.putheader('Host', host_enc)
host_enc.decode("ascii")
self.putheader('Host', "%s:%s" % (host_enc, port)
changed (removed or updated)
self.putheader('Accept-Encoding', 'identity')
self.putheader('TE', 'chunked')
self.putheader('Connection', 'TE')
putheader(self, header, *values)
h.putheader('Accept', 'text/html')
CannotSendHeader()
hasattr(header, 'encode')
header.encode('ascii')
_is_legal_header_name(header)
ValueError('Invalid header name %r' % (header,)
list(values)
enumerate(values)
hasattr(one_value, 'encode')
one_value.encode('latin-1')
isinstance(one_value, int)
str(one_value)
encode('ascii')
_is_illegal_header_value(values[i])
ValueError('Invalid header value %r' % (values[i],)
join(values)
self._output(header)
endheaders(self, message_body=None, *, encode_chunked=False)
CannotSendHeader()
self._send_output(message_body, encode_chunked=encode_chunked)
self._send_request(method, url, body, headers, encode_chunked)
_send_request(self, method, url, body, headers, encode_chunked)
frozenset(k.lower()
self.putrequest(method, url, **skips)
self._get_content_length(body, method)
print('Unable to determine size of %r' % body)
self.putheader('Transfer-Encoding', 'chunked')
self.putheader('Content-Length', str(content_length)
headers.items()
self.putheader(hdr, value)
isinstance(body, str)
_encode(body, 'body')
self.endheaders(body, encode_chunked=encode_chunked)
getresponse(self)
self.__response.isclosed()
isclosed()
ResponseNotReady(self.__state)
self.response_class(self.sock, method=self._method)
response.begin()
self.close()
self.close()
response.close()
HTTPSConnection(HTTPConnection)
super(HTTPSConnection, self)
ssl._create_default_https_context()
context.load_cert_chain(cert_file, key_file)
connect(self)
given (SSL)
super()
connect()
__all__.append("HTTPSConnection")
HTTPException(Exception)
str()
NotConnected(HTTPException)
InvalidURL(HTTPException)
UnknownProtocol(HTTPException)
__init__(self, version)
UnknownTransferEncoding(HTTPException)
UnimplementedFileMode(HTTPException)
IncompleteRead(HTTPException)
__init__(self, partial, expected=None)
__repr__(self)
s(%i bytes read%s)
len(self.partial)
__str__(self)
repr(self)
ImproperConnectionState(HTTPException)
CannotSendRequest(ImproperConnectionState)
CannotSendHeader(ImproperConnectionState)
ResponseNotReady(ImproperConnectionState)
BadStatusLine(HTTPException)
__init__(self, line)