MCPcopy Create free account
hub / github.com/RustPython/RustPython / __init__

Method __init__

Lib/http/client.py:887–908  ·  view source on GitHub ↗
(self, host, port=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
                 source_address=None, blocksize=8192)

Source from the content-addressed store, hash-verified

885 return None
886
887 def __init__(self, host, port=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
888 source_address=None, blocksize=8192):
889 self.timeout = timeout
890 self.source_address = source_address
891 self.blocksize = blocksize
892 self.sock = None
893 self._buffer = []
894 self.__response = None
895 self.__state = _CS_IDLE
896 self._method = None
897 self._tunnel_host = None
898 self._tunnel_port = None
899 self._tunnel_headers = {}
900 self._raw_proxy_headers = None
901
902 (self.host, self.port) = self._get_hostport(host, port)
903
904 self._validate_host(self.host)
905
906 # This is stored as an instance variable to allow unit
907 # tests to replace it with a suitable mockup
908 self._create_connection = socket.create_connection
909
910 def set_tunnel(self, host, port=None, headers=None):
911 """Set up host and port for HTTP CONNECT tunnelling.

Callers

nothing calls this directly

Calls 2

_get_hostportMethod · 0.95
_validate_hostMethod · 0.95

Tested by

no test coverage detected