The Twitter API is a Representational State Transfer (REST)-based resource exposed over HTTP(S),which means that “accessor”methods (those that retrieve data) require a GET operation and “mutator”methods (those that create,update,or destroy data) require a POST operation.
REST-based web services such as the Twitter API consist of three elements:
HTTP operation
How the request is being transferred to the Twitter API.The transfer operations are GET, POST, PUT,and DELETE,as described earlier,and which operation is appropriate depends on the method being executed.Supplying an incorrect operation will result in an error.
Method
A URL that points to the location of a resource on Twitter’s servers.A list of methods appears in the next section,and Chapter 2 further describes these methods. Methods can also include a number of parameters for customizing requests (for example,returning only a certain number of values) or for supplying update text.
Return format
The format in which to return data back,which must be supported by that method.Twitter accommodates Extensible Markup Language (XML),JavaScript Object Notation (JSON),Really Simple Syndication (RSS),and Atom return formats depending on the method that has been executed.For example,changing the URL extension of a request from .xml to .json will adjust the return format.
REST-based web services such as the Twitter API consist of three elements:
HTTP operation
How the request is being transferred to the Twitter API.The transfer operations are GET, POST, PUT,and DELETE,as described earlier,and which operation is appropriate depends on the method being executed.Supplying an incorrect operation will result in an error.
Method
A URL that points to the location of a resource on Twitter’s servers.A list of methods appears in the next section,and Chapter 2 further describes these methods. Methods can also include a number of parameters for customizing requests (for example,returning only a certain number of values) or for supplying update text.
Return format
The format in which to return data back,which must be supported by that method.Twitter accommodates Extensible Markup Language (XML),JavaScript Object Notation (JSON),Really Simple Syndication (RSS),and Atom return formats depending on the method that has been executed.For example,changing the URL extension of a request from .xml to .json will adjust the return format.