MENU
REST
Representational State Transfer (REST) is an abstraction of the World Wide Web.A web service is "RESTful" if it conforms to the following constraints:
- Client-server
- Stateless
- Cacheable
- Layered system
- Code on demand
- Uniform interface
Under the uniform interface constraint, resources are identified by URIs, and standard HTTP methods (GET, POST, PUT, DELETE) act on those resources. A GET request against a resource's URI, for example, can return an XML representation of that resource:
Request:
GET /books/123321 HTTP/1.1
Host: api.example.com
Accept: application/xml
Response:
HTTP/1.1 200 OK
Content-Type: application/xml
<book id="123321">
<title>Harry Potter</title>
<author>J. K. Rowling</author>
<price>22.90</price>
</book>