(self, host, secure)
return connection
get a HTTP[S]Connection.

        Override when a custom connection is required, for example if
        there is a proxy.
get a HTTP[S]Connection.
get a HTTP [ S ] Connection .
def getConnection(self, host, secure):
        """
        get a HTTP[S]Connection.

        Override when a custom connection is required, for example if
        there is a proxy.
        """
        import http.client
        if secure:
            connection = http.client.HTTPSConnection(host, context=self.context)
        else:
            connection = http.client.HTTPConnection(host)
        return connection
def getConnection ( self , host , secure ) : import http . client if secure : connection = http . client . HTTPSConnection ( host , context = self . context ) else : connection = http . client . HTTPConnection ( host ) return connection