MSK Institute LogoMSK.Institute
HomeCourses
Book Free Demo➔Sign In
Free Demo➔
MSK Institute LogoMSK.Institute

Leading computer training academy in Shikohabad for software engineering, Python, web development, and digital literacy.

ISO 9001:2015 Certified Center
Follow & Connect
4.9

Programs & Admissions

  • All CoursesCatalog
  • Learning PathsRoadmaps
  • Student ProjectsShowcase
  • Live Classes & ScheduleLive
  • Upcoming Batches
  • Campuses & LocationsHub
  • Verify Certificates
  • Book Free Demo Class

Resources & Tools

  • Free Online Mock TestsAll Tests
  • NIELIT CCC Mock TestFree
  • Course & Career FinderQuiz
  • Study Material Hub
  • All MSK ToolsHub
  • Keyboard ShortcutsNew
  • TypeQuest Speed LabTyping
  • MSK Code PlaygroundCode
  • Interactive Tutorials
  • Quick Cheatsheets

Institute & Contact

  • About MSK Institute
  • Careers & InternshipsHiring
  • Publications & Blogs
  • Gali No. 3, Near Gyan Jyoti Public School,
    Adarsh Nagar, Shikohabad, Uttar Pradesh 283135
  • +91 83930 42166
  • mskshikohabad@gmail.com
  • Hours:Mon – Sat: 8:00 AM – 7:00 PM | Sun: 10:00 AM – 2:00 PM
  • 4.9 ★(38 Google Reviews)
© 2026 MSK Institute. All rights reserved.•Privacy Policy•Terms of Service•Disclaimer•Contact Us

Shikohabad's Leading Computer & Coding Academy

Home
Courses
Live
Material
REST Principles0%
Study Materials
REST API Development with DjangoProgress 0%
1.1REST Principles1.2HTTP Methods Overview1.3Status Codes
HomeTutorialsREST API Development with DjangoREST Principles
HTTP Methods Overview

REST Principles

Beginner12 min read•Updated: 2026-11-18•By Er. Sumit Kumar (MSK Institute)
Study MaterialsCheatsheet

REST Architectural Principles and Statelessness

Representational State Transfer (REST) is an architectural style designed by Roy Fielding in 2000 for distributed hypermedia systems. REST governs how modern web services communicate over HTTP, enabling clients (web SPAs, mobile apps, IoT devices) and backend servers to interact reliably, securely, and scalably.


1. The Six Guiding Architectural Constraints of REST

To be considered a true RESTful system, an API architecture must satisfy six constraints:

1┌─────────────────────────────────────────────────────────────┐
2│ SIX REST ARCHITECTURAL PILLARS │
3├─────────────────────────────────────────────────────────────┤
4│ 1. Client-Server Separation (UI concerns decoupled from db) │
5│ 2. Statelessness (Each request carries complete context) │
6│ 3. Cacheability (Responses explicitly declare caching rules)│
7│ 4. Uniform Interface (Resource URIs, representations) │
8│ 5. Layered System (Proxies, gateways, CDNs transparent) │
9│ 6. Code on Demand (Optional: sending executable scripts) │
10└─────────────────────────────────────────────────────────────┘

2. The Core Principle: Statelessness

Statelessness mandates that no client session context is stored on the server between requests. Every single incoming request must contain all the information necessary for the server to understand, authenticate, and process it.

Stateful vs Stateless Comparison:

1Stateful Architecture (Anti-pattern for scalable APIs):
2Client ──► "Log me in" ──► Server creates session in memory (Session ID: 101)
3Client ──► "Show my invoices" (Cookie: 101) ──► Server looks up memory for 101
4* Problem: If Server A crashes or traffic is routed to Server B, session 101 is lost!
5 
6Stateless Architecture (RESTful):
7Client ──► "Log me in" ──► Server issues signed cryptographic JWT token
8Client ──► "Show my invoices" (Authorization: Bearer <JWT>)
9* Benefit: ANY server instance can verify the signature and process the request independently!

3. Uniform Interface & Resource-Oriented URIs

In REST, everything is a Resource. Resources are identified by stable, noun-based URIs (never verbs or actions):

Bad URI (RPC / Action-based)Good RESTful URI (Resource-based)HTTP Method
/api/getInvoices/api/v1/invoices/GET
/api/createInvoice/api/v1/invoices/POST
/api/updateInvoice?id=4/api/v1/invoices/4/PUT or PATCH
/api/deleteInvoice/4/api/v1/invoices/4/DELETE

4. Richardson Maturity Model

The Richardson Maturity Model breaks down the progression towards true REST:

  • Level 0 (The Swamp of POX): Single HTTP endpoint with raw RPC calls (e.g. SOAP or basic XML-RPC).
  • Level 1 (Resources): Distinct URIs for individual resources (/orders/123), but uses single HTTP methods.
  • Level 2 (HTTP Verbs): Uses standard HTTP methods (GET, POST, PUT, DELETE) with meaningful HTTP status codes (200, 201, 404). Most production APIs operate here.
  • Level 3 (HATEOAS): Hypermedia As The Engine Of Application State—responses include dynamic links guiding the client on valid subsequent actions.

Interactive Quiz• Knowledge Check

Practice Quiz

Question 1
What does the "Statelessness" constraint require in a RESTful API architecture?
Question 2
Why are noun-based URIs (/api/v1/orders/) preferred over verb-based URIs (/api/v1/createOrder/) in REST?
Question 3
What is the highest level (Level 3) of the Richardson Maturity Model for REST APIs?
Question 4
How does the Client-Server Separation constraint benefit modern distributed applications?
Question 5
What is a major scalability benefit of statelessness when deploying backend services behind a load balancer?
Next Lesson

HTTP Methods Overview

Continue learning with hands-on practice, examples, and exercises in the upcoming topic.

Related Lessons

Previous LessonNext Lesson
NoneHTTP Methods Overview

Practice Quiz

Test your understanding of this lesson with 5 questions. Each question has one correct answer.

Mentor-Led Practical Training

Master REST API Development with Django with Hands-On Projects

Practice in live mentor-led sessions with real projects, mock tests, and verifiable certification at MSK Institute.

View Full CourseBook Free Demo
Next
PreviousPrevNext