RESTing with Facebook
Problem
I’m curious to know more about how my app communicates with Facebook. What kind of API is this?
Solution
This is a Representational State Transfer, or REST-like API, which means that calls are simply made over HTTP (using GET or POST) to the Facebook server. You’ll be POSTing requests to http://api.facebook.com/restserver.php when you make calls from your server, but you can visit that URL directly if you’re curious to see what a 101 error response looks like (and who isn’t, really?).
Discussion
The alternative to REST is generally considered to be SOAP, a heavier-weight protocol that includes an additional message layer. The two are very similar in some regards (both generally use HTTP as their transport protocol and generally use XML to encode data), but there’s a lot more overhead in implementing a SOAP-based API. More information about REST and SOAP can be found at http://en.wikipedia.org/wiki/Representational_State_Transfer and http://en.wikipedia.org/wiki/SOAP, respectively.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access