---
title: "Short note: REST"
subject: "Web Technology"
chapter: 8
key: "semester_7/web_technology:short-note-rest"
source: https://www.bctengineer.com/q/semester_7/web_technology/short-note-rest
site: BCT Engineering
---

# Short note: REST

Web Technology · Chapter 8: Web services

- Asked in: 2074 Asoj, 3 marks; 2074 Chaitra (asked 2 times)
- Video: [What Is REST API? Examples And How To Use It: Crash Course System Design #3](https://www.youtube.com/watch?v=-mN3VyJuCjM) — ByteByteGo
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_7/web_technology/short-note-rest
- Whole chapter: https://www.bctengineer.com/md/semester_7/web_technology/chapter-8

## Question

Write a short note on REST (Representational State Transfer).

## 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.

## Answer

**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)
1. **Client-server:** The user interface and data storage are separate.
2. **Stateless:** Each request contains all the information needed; the server keeps no client session between requests.
3. **Cacheable:** Responses can be marked cacheable to improve performance.
4. **Uniform interface:** Resources are identified by URIs and manipulated through their *representations* (JSON, XML or HTML) using standard HTTP methods.
5. **Layered system:** Proxies and gateways can sit between client and server.
6. **Code on demand (optional):** The server can send executable code (such as JavaScript) to extend the client.

#### Example
```text
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.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What does the stateless constraint of REST mean?
   A. The server stores a session for every client
   B. Each request carries all information needed; the server keeps no client session between requests
   C. Responses can never be cached
   D. Clients cannot send data to the server
   Answer: B. In REST every request is self-contained and the server keeps no client session. (Key point: Stateless constraint)

2. In a RESTful service, which request would delete student 5?
   A. GET /api/students/5
   B. POST /api/students/5
   C. DELETE /api/students/5
   D. PUT /api/students
   Answer: C. Resources are identified by URLs and DELETE removes them. (Key point: HTTP methods on resources)

3. Compared with SOAP, REST is advantageous because:
   A. It needs a heavy XML envelope and WSDL
   B. It is lightweight, can use JSON and needs no XML envelope or WSDL
   C. It only works with one programming language
   D. It does not use HTTP
   Answer: B. REST uses ordinary HTTP and light representations like JSON without envelopes or WSDL. (Key point: REST vs SOAP)

## Related in other subjects

- [Find K and b for K(s+1)/(s³+bs²+3s+1)](https://www.bctengineer.com/question.md?key=semester_3%2Fcontrol_systems%3Arh-k-b-oscillate) — Control Systems, chapter 4
- [Brake energy and drum temperature rise](https://www.bctengineer.com/question.md?key=semester_7%2Fmachine_design_ii%3Abrake-energy-absorbed-temperature-rise) — Machine Design II, chapter 7
