Rest Architecture
Rest Architecture
Architecture
Introduction......
REST:
Roy Fielding (2000)
• REST is an acronym
for REpresentational State Tr
ansfer and an architectural style
for distributed hypermedia
systems.
• REST is not a protocol or a
standard, it is an architectural
style.
• It relies on a stateless, client-
server, cacheable
communications protocol — and
in virtually all cases, the HTTP
protocol is used.
• REST is an architecture
style for designing
networked applications.
The idea is that, rather than
using complex mechanisms
such as CORBA, RPC or
SOAP to connect between
machines, simple HTTP is
used to make calls between
machines.
REST API
Statelessness
mandates that each The server
request from the client cannot take
to the server must advantage of
contain all of the any previously
information necessary stored context
to understand and information on
complete the request. the server.
4. Cacheable
If the response is
The cacheable
cacheable, the client
constraint requires that
application gets the
a response should
right to reuse the
implicitly or explicitly
response data later for
label itself as cacheable
equivalent requests and
or non-cacheable.
a specified period.
5. Layered System
"id": 123,
"title": "What is REST",
"content": "REST is an architectural style for building web services...",
"published_at": "2023-11-04T14:30:00Z",
"author": { "id": 456, "name": "John Doe",
"profile_url": "https://example.com/authors/456" },
"comments": { "count": 5,
"comments_url": "https://example.com/posts/123/comments" },
"self": { "link": "https://example.com/posts/123" }
}
Benefits of using REST
Architecture