

def _request_uri(self, uri='', method='GET', params={
    
}, headers={
    
}, body=''):
    "Assembles the request uri and calls the request method.\n\n        Required Arguments:\n            uri: string - the assembled API endpoint.\n\n        Optional Parameters:\n            method: string - the method of the request. Possible values are\n                'GET', 'POST', 'DELETE', 'PUT'\n            params: dict - parameters to pass along\n            headers: dict - any specific http headers\n            body: string - request body, only used on a few PUT statements\n\n        Returns:\n            typically, JSON - depends on the API call, refer to the other\n                method docstrings for more details.\n        "
    url = '/'.join((self.url_base, response.api_version, uri))
    try:
        lib_version = pkg_resources.require('contextio')[0].version
    except:
        lib_version = 'dev'
    headers.update({
        'user-agent': 'contextio/{0}/python-lib-{1}'.format(self.api_version, lib_version),
    })
    if (method == 'POST'):
        params['body'] = body
        response = self.session.request(method, url, header_auth=True, data=params, headers=headers)
    else:
        response = self.session.request(method, url, header_auth=True, params=params, headers=headers, data=body)
    self._debug(response)
    try:
        response_body = response.json()
    except UnicodeDecodeError:
        response_body = response.content
    except ValueError:
        response_body = response.text
    if ((response.status_code >= 200) and (response.status_code < 300)):
        return response_body
    else:
        raise RequestError('Request to {0} failed with HTTP status code {1}: {2}'.format(url, response.status_code, response_body), response=response)

dataset/ETHPy150Open contextio/Python-ContextIO/contextio/lib/api.py Api._request_uri/VarMisuse@49/265 `self`->`response`