- Asked 2/4
- 2074 Asoj · 3 marks
- 2074 Chaitra
Short note: REST
Short answer
REST (Representational State Transfer) is an architectural style for web services proposed by Roy Fielding. It treats everything as a resource identified by URI, uses standard HTTP methods (GET, POST, PUT, DELETE) on representations (JSON, XML), and enforces statelessness, cacheability, uniform interface, and client-server separation, making services simple and scalable.
Write a short note on REST (Representational State Transfer).
REST (Representational State Transfer) is an architectural style for designing networked applications and web services, proposed by Roy Fielding in his doctoral thesis (2000). Services built on it are called RESTful and use ordinary HTTP to work with resources identified by URLs.
Principles (constraints)
- Client-server: The user interface and data storage are separate.
- Stateless: Each request contains all the information needed; the server keeps no client session between requests.
- Cacheable: Responses can be marked cacheable to improve performance.
- Uniform interface: Resources are identified by URIs and manipulated through their representations (JSON, XML or HTML) using standard HTTP methods.
- Layered system: Proxies and gateways can sit between client and server.
- Code on demand (optional): The server can send executable code (such as JavaScript) to extend the client.
Example
GET /api/students/5 -> read student 5 (JSON)
POST /api/students -> create a student
PUT /api/students/5 -> update student 5
DELETE /api/students/5 -> delete student 5
Advantages
Simple, lightweight (JSON), fast, scalable, uses existing HTTP infrastructure and works with any language. Compared with SOAP, it needs no heavy XML envelope or WSDL.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Find K and b for K(s+1)/(s³+bs²+3s+1) · Control Systems, chapter 4
- Brake energy and drum temperature rise · Machine Design II, chapter 7