Thuzi/facebook-node-sdk — pull request #13 by prabirshrestha (2012-06-16 02:04:51+00:00)
Title: FB.api can now handle oauth text/plain responses (#11)

pull request for #11

FB.api is now aware of text/plain oauth responses. so the following code or any oauth 2 request will now work.

```js
FB.api('oauth/access_token', {client_id: '...', client_secret: '...', grant_type: 'client_credentials' }, function (res) {
console.log(res);
})
```

I still think this might not be a good idea as we have to do regex test every time for a graph api call that results in 200ok status.

@jimzim @jschluchter should we make `FB.api` work with oauth response or create a new method and use `FB.oauth` instead. What do you guys think?

By the way fb c# sdk in v6 uses this same approach so `FacebookClient.Get("oauth/access_token")` works. One good thing about this method is no new api is introduced and devs can leverage existing knowledge.