Just the core of the pycurl logic.

def pull_core(self, **kwargs):
        """
        Just the core of the pycurl logic.
        """

        str_ip              = self.str_ip
        str_port            = self.str_port
        verbose             = 0
        d_msg               = {}

        for k,v in kwargs.items():
            if k == 'ip':       str_ip      = v
            if k == 'port':     str_port    = v
            if k == 'msg':      d_msg       = v
            if k == 'verbose':  verbose     = v

        response            = io.BytesIO()

        str_query   = ''
        if len(d_msg):
            d_meta              = d_msg['meta']
            str_query           = '?%s' % urllib.parse.urlencode(d_msg)
        
        str_URL = "%s://%s:%s%s%s" % (self.str_protocol, str_ip, str_port, self.str_URL, str_query)
        self.dp.qprint(str_URL,
                    comms  = 'tx')


        c = pycurl.Curl()
        c.setopt(c.URL, str_URL)
        # pudb.set_trace()
        if self.b_unverifiedCerts:
            self.dp.qprint("Making an insecure connection with trusted host")
            c.setopt(pycurl.SSL_VERIFYPEER, 0)   
            c.setopt(pycurl.SSL_VERIFYHOST, 0)
        if verbose: c.setopt(c.VERBOSE, 1)
        c.setopt(c.FOLLOWLOCATION,  1)
        c.setopt(c.WRITEFUNCTION,   response.write)
        if len(self.str_auth):
            self.dp.qprint("Using user:password authentication <%s>" % 
                            self.str_auth)
            c.setopt(c.USERPWD, self.str_auth)
        elif len(self.str_authToken):
            self.dp.qprint("Using token-based authorization <%s>" % 
                            self.str_authToken)
            header = 'Authorization: bearer %s' % self.str_authToken
            c.setopt(pycurl.HTTPHEADER, [header])
        self.dp.qprint("Waiting for PULL response...", level = 1, comms ='status')
        c.perform()
        c.close()
        try:
            str_response        = response.getvalue().decode()
        except:
            str_response        = response.getvalue()

        self.dp.qprint('Incoming transmission received, length = %s' % "{:,}".format(len(str_response)),
                    level = 1, comms ='rx')
        return str_response