def METHOD_NAME(
        self, query, *, use_http_post=True, variables=None, globals=None):
    req_data = {
        'query': query
    }
    if use_http_post:
        if variables is not None:
            req_data['variables'] = variables
        if globals is not None:
            req_data['globals'] = globals
        req = urllib.request.Request(self.http_addr, method='POST')
        req.add_header('Content-Type', 'application/json')
        response = urllib.request.urlopen(
            req, json.dumps(req_data).encode(), context=self.tls_context
        )
        resp_data = json.loads(response.read())
    else:
        if variables is not None:
            req_data['variables'] = json.dumps(variables)
        if globals is not None:
            req_data['globals'] = json.dumps(globals)
        response = urllib.request.urlopen(
            f'{self.http_addr}/?{urllib.parse.urlencode(req_data)}',
            context=self.tls_context,
        )
        resp_data = json.loads(response.read())
    if 'data' in resp_data:
        return resp_data['data']
    err = resp_data['error']
    ex_msg = err['message'].strip()
    ex_code = err['code']
    raise edgedb.EdgeDBError._from_code(ex_code, ex_msg)