'A simple HTTP request interface.
Note: this overloads the `request` method from the parent class and
thus must implement the same method signature.'

def request(self, method, url, extra_headers=False, headers=None, body=None, chunked=False):

    if (headers is None):
        headers = self.get_headers(accept_type='json')
    elif extra_headers:
        try:
            headers.update(self.get_headers(accept_type='json'))
        except (ValueError, TypeError):
            headers = self.get_headers(accept_type='json')
    (resp, resp_body) = self.raw_request(url, method, headers=headers, body=body)
    self._log_request(method, url, resp, req_headers=headers, req_body='<omitted>', resp_body=resp_body)
    if (resp.status in [401, 403]):
        resp_body = json.loads(resp_body)
        raise exceptions.Unauthorized(resp_body['error']['message'])
    elif (resp.status not in [200, 201, 204]):
        raise exceptions.IdentityError('Unexpected    status    code    {0}'.format(resp.status))
    return (resp, json.loads(resp_body))
