Facebook exposes an interface to application developers based on Representational State Transfer (REST). REST is an architectural style that uses Hypertext Transfer Protocol (HTTP).This section discusses how REST works and then describes how Facebook expects developers to use it. Using REST on the Web The majority of the web uses HTTP and, therefore, REST implementations can take advantage of the many features that the web offers, such as interoperability, scalability, security, and standard URLs.
REST deals with everything as resources, addressed using standard URIs. The basic tenets of REST are as follows: n URIs are resources. (Example: http://server.com/person/john/) REST is stateless on the server: The state is contained on the client and is passed to the server as part of the URI. For example, a user might get a list of restaurants in Massachusetts by going to http://server.com/restaurants/ma/.
She might then click one of the resulting restaurant names (Mangia, for example) to get more information, resulting in the URL http://server.com/restaurants/ma/mangia/.This process continues as the user narrows her search, and it might eventually include additional information as query parameters, such as http://server.com/restaurants/ma/mangia/?search=pizza, to find what types of pizza Mangia serves.
HTTP verbs are the methods. (Example: GET, POST, PUT, and DELETE) In general, GET should be a read-only, repeatable operation to return resource information. This allows servers to easily cache and scale. POST, PUT, and DELETE change the resource.