Hello! In our previous lessons, we've focused on the fundamental mechanics of web communication: the structure of HTTP requests and responses, the roles of different HTTP methods, and how to interpret status codes. You've learned how a client and server talk to each other. Now, we'll explore the architectural style that brings order and predictability to these conversations: REST.
This lesson introduces the core principles of REpresentational State Transfer (REST). While you have practical experience using Postman to test APIs, this lesson will provide the conceptual "why" behind the API designs you've encountered. Understanding these principles is the foundation for designing effective and robust API tests.
By the end of this lesson, you will be able to explain the core REST principles of resources, endpoints, and statelessness, which will set the stage for you to begin writing automated tests with REST Assured.
What is REST?
First, it's important to understand what REST is—and what it isn't. REST is not a protocol, a library, or a specific technology. It is an architectural style, a set of guiding principles or constraints for building scalable, simple, and reliable web services. APIs that adhere to these principles are called "RESTful" APIs.
These principles were defined to leverage the existing, proven technology of the web: the HTTP protocol. Let's start with a clear, practical video that explains what REST is and how it provides a convention for building HTTP services.
This video from Programming with Mosh provides an excellent introduction to REST, connecting it to the client-server architecture and HTTP protocol you're already familiar with.
Watch the first part of the video, from the beginning up to 01:24. This will establish the basic idea of REST as a convention for the services that power our applications.
As Mosh explains, REST provides a standardized way to perform basic data operations: Create, Read, Update, and Delete (CRUD). Let's break down the core principles that enable this.
Principle 1: Everything is a Resource
The central idea in REST is the resource. A resource is any object, piece of data, or service that can be identified and addressed. Think of them as the "nouns" of your application. In a system for an online store, the resources might be:
- A specific customer
- A list of all products
- An order
- An image for a product
Each resource is identified by a unique address called a Uniform Resource Identifier (URI). When you see a URL for an API, the path portion of that URL is the URI that identifies the resource. This address is often called an endpoint.
For example:
/userscould be the endpoint for the collection of all users./users/42could be the endpoint for the single user with ID 42.
It's a common convention to use plural nouns for endpoints that represent a collection of resources.
The following video continues this idea, explaining how we define endpoints to work with resources like customers or movies.
This segment explains the concept of a resource and an endpoint using a clear, practical example of a movie rental application.
Please watch from 01:24 to 02:56. Pay close attention to how the URL is structured to identify the collection of customers as the resource.
To reinforce this, another short video explains why using nouns (like /products) is preferred over verbs (like /getAllProducts) in RESTful design.
What Is REST API? Examples And How To Use It: Crash Course System Design #3
This clip from ByteByteGo clearly states the "noun, not verb" rule for organizing resources.
Watch from 00:56 to 01:19 for a concise explanation of this key design principle.
Principle 2: Manipulate Resources with HTTP Methods
Once you have an endpoint for a resource, how do you tell the server what you want to do with it? This is where the HTTP methods you learned about earlier come into play. REST assigns a specific CRUD operation to each standard HTTP method.
- GET: Read a resource.
- POST: Create a new resource.
- PUT / PATCH: Update an existing resource.
- DELETE: Remove a resource.
By combining a resource's endpoint with an HTTP method, you create a clear, predictable action.
| Action | HTTP Method | Endpoint Example | Description |
|---|---|---|---|
| Read all users | GET |
/users |
Retrieves a list of all user resources. |
| Read a single user | GET |
/users/123 |
Retrieves the specific user with ID 123. |
| Create a new user | POST |
/users |
Adds a new user resource to the collection. |
| Update a user | PUT |
/users/123 |
Replaces the entire user resource with ID 123. |
| Delete a user | DELETE |
/users/123 |
Removes the user resource with ID 123. |
This mapping of verbs (HTTP methods) to nouns (resources) is the heart of RESTful interaction. The video from Mosh Hamedani walks through this beautifully.
This part of the video demonstrates exactly how GET, POST, PUT, and DELETE are used with a resource endpoint to perform all the necessary CRUD operations.
Watch from 02:56 to 05:12. This is one of the most important concepts for understanding how to test REST APIs.
Principle 3: Statelessness
The third core principle is statelessness. This means that the server does not store any information about the client's session between requests. Each request sent from the client must be self-contained and include all the information the server needs to understand and process it.
Think of it like interacting with a vending machine. Each time you buy a snack, it's a completely new transaction. The machine doesn't remember that you bought chips five minutes ago. You have to insert money and make your selection every single time.
In contrast, a telephone call is stateful. Both parties remember the context of the conversation.

Why is this important?
- Scalability: Since no session state is stored, a client's request can be handled by any server. This makes it easy to add more servers and distribute the load.
- Reliability: If one server fails, the client can simply send the exact same request to another server, and it will work just fine.
To solidify your understanding, please read the following explanation of statelessness.
What is REST API (RESTful API)? Explained
This article from Codecademy provides clear, concise definitions of the key REST principles.
Focus on the two sections titled Client-server architecture and Statelessness. These paragraphs explain the concepts and their benefits very well.
Bringing It All Together
The image below provides a great summary of how these principles come together in a single API call.

You can see:
- The HTTP Method (
GET) indicating the action (Read). - The Endpoint (
/v1/users) identifying the resource (a collection of version 1 users). - Parameters (
?age=25&gender=male) for filtering the resource, which are part of the self-contained request.
The server receives this complete request, processes it, and returns a representation of the resource (likely in JSON format), without needing to know anything about previous requests you may have sent.
To see how these principles translate into designing a real API, the Codecademy article provides a practical example.
What is REST API (RESTful API)? Explained
This section of the article walks through the design process for a simple photo collection API.
Read through the section titled Designing a REST system. Notice how they first define the resources (Models) and then map the GET, POST, PUT, and DELETE requests to the corresponding endpoints.
Conclusion
In this lesson, we moved from the mechanics of HTTP to the architectural philosophy of REST. You now have the conceptual framework to understand how and why RESTful APIs are structured the way they are.
Here are the key takeaways:
- REST is an architectural style for building web services, not a strict protocol.
- It is built around resources (nouns), which are identified by unique URIs called endpoints.
- Standard HTTP methods (GET, POST, PUT, DELETE) are used as verbs to perform CRUD operations on these resources.
- RESTful communication is stateless, meaning every request must be independent and self-contained. This makes the system more scalable and reliable.
We've mentioned that APIs often return data in a "representation" format. The most common format used in modern APIs is JSON. In our next lesson, we will dive into reading and writing JSON structures. Mastering JSON is essential for creating request payloads and for validating the data you get back in API responses.