What is REST, REST API?

From ScenarioThinking
Jump to navigation Jump to search

REST was introduced by Roy Fielding to describe the web architecture. REST stands for Representational State Transfer.


Web comprises of various resources. A resource is any item of interest that has an URI. Using URI (eg: http://www.example.com/test.html) a "representation" of a resource is returned (test.html). The representation places the client application in a "state". Through the hyperlink, another resource is accessed and the new representation places the client application into a new state. Thus the client "transfers" the state with each resource representation.


"REST is not a standard but uses the following standards:

  • HTTP
  • URL
  • XML/HTML/GIF/JPEG/etc (Resource Representations)
  • text/xml, text/html, image/gif, image/jpeg, etc (MIME Types)" (source:[1] )


In a nutshell, REST is a web architecture in which the client submits an HTTP request to a specified URL. The response contains data mostly in XML format.


REST API's:

REST API's are designed to interact with the web servers using a simple URL over HTTP and the response are returned in XML format.

Here is an example of a call that uses the REST API of "ebay":

http://rest.api.ebay.com/restapi?CallName=GetSearchResults&RequestToken=xyz123&RequestUserId=ebayuser&Query=toy%20boat&Schema=1

This REST API will provide data in response to a request in an XML format that they support.


Reference:

http://webservices.xml.com/pub/a/ws/2003/09/30/soa.html

http://naeblis.cx/rtomayko/2004/12/12/rest-to-my-wife

http://en.wikipedia.org/wiki/Representational_State_Transfer

http://developer.ebay.com/developercenter/rest