

@_auth_return_future
def twitter_request(self, path, callback=None, access_token=None, post_args=None, **args):
    'Fetches the given API path, e.g., ``statuses/user_timeline/btaylor``\n\n        The path should not include the format or API version number.\n        (we automatically use JSON format and API version 1).\n\n        If the request is a POST, ``post_args`` should be provided. Query\n        string arguments should be given as keyword arguments.\n\n        All the Twitter methods are documented at http://dev.twitter.com/\n\n        Many methods require an OAuth access token which you can\n        obtain through `~OAuthMixin.authorize_redirect` and\n        `~OAuthMixin.get_authenticated_user`. The user returned through that\n        process includes an \'access_token\' attribute that can be used\n        to make authenticated requests via this method. Example\n        usage::\n\n            class MainHandler(tornado.web.RequestHandler,\n                              tornado.auth.TwitterMixin):\n                @tornado.web.authenticated\n                @tornado.web.asynchronous\n                @tornado.gen.coroutine\n                def get(self):\n                    new_entry = yield self.twitter_request(\n                        "/statuses/update",\n                        post_args={"status": "Testing Tornado Web Server"},\n                        access_token=self.current_user["access_token"])\n                    if not new_entry:\n                        # Call failed; perhaps missing permission?\n                        yield self.authorize_redirect()\n                        return\n                    self.finish("Posted a message!")\n\n        '
    if (path.startswith('http:') or path.startswith('https:')):
        url = path
    else:
        url = ((self._TWITTER_BASE_URL + path) + '.json')
    if access_token:
        all_args = {
            
        }
        all_args.update(args)
        all_args.update((post_args or {
            
        }))
        method = ('POST' if (post_args is not None) else 'GET')
        oauth = self._oauth_request_parameters(callback, access_token, all_args, method=method)
        args.update(oauth)
    if args:
        url += ('?' + urllib_parse.urlencode(args))
    http = self.get_auth_http_client()
    http_callback = self.async_callback(self._on_twitter_request, callback)
    if (post_args is not None):
        http.fetch(url, method='POST', body=urllib_parse.urlencode(post_args), callback=http_callback)
    else:
        http.fetch(url, callback=http_callback)

dataset/ETHPy150Open D-L/SimpleBookMarks/src/tornado/auth.py TwitterMixin.twitter_request/VarMisuse@129/642 `url`->`callback`