Python httplib.HTTP_PORT Examples
The following are 7
code examples of httplib.HTTP_PORT().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
httplib
, or try the search function
.
Example #1
Source File: emrthttpclient.py From galaxy-sdk-python with Apache License 2.0 | 6 votes |
def __init__(self, credential, uri_or_host, timeout, thrift_protocol, support_account_key): self.credential = credential self.uri = uri_or_host parsed = urlparse.urlparse(uri_or_host) self.scheme = parsed.scheme assert self.scheme in ('http', 'https') if self.scheme == 'http': self.port = parsed.port or httplib.HTTP_PORT elif self.scheme == 'https': self.port = parsed.port or httplib.HTTPS_PORT self.host = parsed.hostname self.path = parsed.path if parsed.query: self.query = parsed.query self.path += '?%s' % parsed.query self.__timeout = timeout self.__protocol = thrift_protocol self.support_account_key = support_account_key self.__wbuf = StringIO() self.__http = None self.__custom_headers = None self.__clock_offset = 0
Example #2
Source File: sdsthttpclient.py From galaxy-sdk-python with Apache License 2.0 | 6 votes |
def __init__(self, credential, uri_or_host, timeout=None, thrift_protocol=ThriftProtocol.TBINARY): self.credential = credential parsed = urlparse(uri_or_host) self.scheme = parsed.scheme assert self.scheme in ('http', 'https') if self.scheme == 'http': self.port = parsed.port or httplib.HTTP_PORT elif self.scheme == 'https': self.port = parsed.port or httplib.HTTPS_PORT self.host = parsed.hostname self.path = parsed.path if parsed.query: self.path += '?%s' % parsed.query self.__timeout = timeout self.__protocol = thrift_protocol self.__wbuf = StringIO() self.__http = None self.__custom_headers = None self.__clock_offset = 0
Example #3
Source File: thttpclient.py From galaxy-sdk-python with Apache License 2.0 | 6 votes |
def __init__(self, credential, uri_or_host, timeout=None, thrift_protocol=ThriftProtocol.TBINARY): self.credential = credential parsed = urlparse(uri_or_host) self.scheme = parsed.scheme assert self.scheme in ('http', 'https') if self.scheme == 'http': self.port = parsed.port or httplib.HTTP_PORT elif self.scheme == 'https': self.port = parsed.port or httplib.HTTPS_PORT self.host = parsed.hostname self.path = parsed.path if parsed.query: self.path += '?%s' % parsed.query self.__timeout = timeout self.__protocol = thrift_protocol self.__wbuf = StringIO() self.__http = None self.__custom_headers = None self.__clock_offset = 0
Example #4
Source File: http.py From thriftpy2 with MIT License | 6 votes |
def __init__(self, uri, timeout=None, ssl_context_factory=None): """Initialize a HTTP Socket. @param uri(str) The http_scheme:://host:port/path to connect to. @param timeout timeout in ms """ parsed = urllib.parse.urlparse(uri) self.scheme = parsed.scheme assert self.scheme in ('http', 'https') if self.scheme == 'http': self.port = parsed.port or http_client.HTTP_PORT elif self.scheme == 'https': self.port = parsed.port or http_client.HTTPS_PORT self.host = parsed.hostname self.path = parsed.path if parsed.query: self.path += '?%s' % parsed.query self.__wbuf = BytesIO() self.__http = None self.__custom_headers = None self.__timeout = None if timeout: self.setTimeout(timeout) self._ssl_context_factory = ssl_context_factory
Example #5
Source File: THttpClient.py From galaxy-sdk-python with Apache License 2.0 | 5 votes |
def __init__(self, uri_or_host, port=None, path=None): """THttpClient supports two different types constructor parameters. THttpClient(host, port, path) - deprecated THttpClient(uri) Only the second supports https. """ if port is not None: warnings.warn( "Please use the THttpClient('http://host:port/path') syntax", DeprecationWarning, stacklevel=2) self.host = uri_or_host self.port = port assert path self.path = path self.scheme = 'http' else: parsed = urlparse.urlparse(uri_or_host) self.scheme = parsed.scheme assert self.scheme in ('http', 'https') if self.scheme == 'http': self.port = parsed.port or httplib.HTTP_PORT elif self.scheme == 'https': self.port = parsed.port or httplib.HTTPS_PORT self.host = parsed.hostname self.path = parsed.path if parsed.query: self.path += '?%s' % parsed.query self.__wbuf = StringIO() self.__http = None self.__timeout = None self.__custom_headers = None
Example #6
Source File: LineTransport.py From LineVodka with GNU General Public License v3.0 | 5 votes |
def __init__(self, uri_or_host, port=None, path=None): if port is not None: warnings.warn( "Please use the THttpClient('http://host:port/path') syntax", DeprecationWarning, stacklevel=2) self.host = uri_or_host self.port = port assert path self.path = path self.scheme = 'http' else: parsed = urlparse.urlparse(uri_or_host) self.scheme = parsed.scheme assert self.scheme in ('http', 'https') if self.scheme == 'http': self.port = parsed.port or httplib.HTTP_PORT elif self.scheme == 'https': self.port = parsed.port or httplib.HTTPS_PORT self.host = parsed.hostname self.path = parsed.path if parsed.query: self.path += '?%s' % parsed.query self.__wbuf = StringIO() self.__http = None self.__timeout = None self.__custom_headers = {}
Example #7
Source File: LineTransport.py From BotProtectLine with GNU General Public License v3.0 | 5 votes |
def __init__(self, uri_or_host, port=None, path=None): if port is not None: warnings.warn( "Please use the THttpClient('http://host:port/path') syntax", DeprecationWarning, stacklevel=2) self.host = uri_or_host self.port = port assert path self.path = path self.scheme = 'http' else: parsed = urlparse.urlparse(uri_or_host) self.scheme = parsed.scheme assert self.scheme in ('http', 'https') if self.scheme == 'http': self.port = parsed.port or httplib.HTTP_PORT elif self.scheme == 'https': self.port = parsed.port or httplib.HTTPS_PORT self.host = parsed.hostname self.path = parsed.path if parsed.query: self.path += '?%s' % parsed.query self.__wbuf = StringIO() self.__http = None self.__timeout = None self.__custom_headers = {}