def make_oauth_request(self, request_url, method='GET', body=None):
        if not self.consumer or not self.token:
            logging.error('Missing OAuth credentials')
            return None

        oauth_client = oauth2.Client(self.consumer, self.token)
        if body:
            response, content = oauth_client.request(request_url, method,
                body)
        else:
            response, content = oauth_client.request(request_url, method)

        try:
            json_response = json.loads(content)
        except __HOLE__, e:
            logging.error('Invalid response: %s (%s)' % (e,
                response['status']))
            return None

        return json_response
dataset/ETHPy150Open dasevilla/tumblr-python/tumblr/__init__.py/TumblrClient.make_oauth_request