'Fetches the given relative API path, e.g., "/btaylor/picture"
If the request is a POST, ``post_args`` should be provided. Query
string arguments should be given as keyword arguments.
An introduction to the Facebook Graph API can be found at
http://developers.facebook.com/docs/api
Many methods require an OAuth access token which you can
obtain through `~OAuth2Mixin.authorize_redirect` and
`get_authenticated_user`. The user returned through that
process includes an ``access_token`` attribute that can be
used to make authenticated requests via this method.
Example usage::
class MainHandler(tornado.web.RequestHandler,
tornado.auth.FacebookGraphMixin):
@tornado.web.authenticated
@tornado.gen.coroutine
def get(self):
new_entry = yield self.facebook_request(
"/me/feed",
post_args={"message": "I am posting from my Tornado application!"},
access_token=self.current_user["access_token"])
if not new_entry:
# Call failed; perhaps missing permission?
yield self.authorize_redirect()
return
self.finish("Posted a message!")
The given path is relative to ``self._FACEBOOK_BASE_URL``,
by default "https://graph.facebook.com".
.. versionchanged:: 3.1
Added the ability to override ``self._FACEBOOK_BASE_URL``.'

@_auth_return_future
def facebook_request(self, path, callback, access_token=None, post_args=None, **args):

    url = (self._FACEBOOK_BASE_URL + path)
    all_args = {}
    if access_token:
        all_args['access_token'] = access_token
        all_args.update(args)
    if all_args:
        url += ('?' + urllib_parse.urlencode(all_args))
    callback = functools.partial(self._on_facebook_request, callback)
    http = self.get_auth_http_client()
    if (post_args is not None):
        http.fetch(url, method='POST', body=urllib_parse.urlencode(post_args), callback=callback)
    else:
        http.fetch(url, callback=callback)
