Introduction
The beauty of the World Wide Web is its simplicity in addressing any resource using a simple URI (Uniform Resource Identifier) wherever it exists or whatever type it may be. This architectural success is the basis of Representational State Transfer (REST).
HTTP (Hypertext Transfer Protocol) is the most simple, scalable, stateless, and open protocol used on the Web. The two most popular verbs used are GET
and POST
. GET
returns a specific resource requested, while POST
creates a new resource. REST services provide simple URI access to resources exposed over HTTP. REST supports four HTTP verbs: GET
, POST
, PUT
, and DELETE
. Unlike POST
, PUT
modifies an existing resource. DELETE
removes the resource. In this chapter let's explore different providers such as CNN and Twitter, and build a simple REST service.
Different types of content or media are available like the following popular ones:
XML – application/xml
RSS – application/rss+xml
ATOM – application/atom+xml
JSON – application/json...