Skip to content

Make Selenium Easy

And Keep It That Way

  • Home
  • Share
  • Toggle search form

API Testing Tutorial Part 8 – Introduction to REST & REST API

Posted on 03/21/2025 By admin

Hello Folks,

As part of our API Testing series, we will see below topics in this post:

  1. What is REST?
  2. Six principles of REST.

What is REST?

REST stands for REpresentational State Transfer. It is an architectural style that defines a set of constraints to be used for creating web services or API. Web services which are built using REST are called REST API or RESTFul API or web services. These web services provide interoperability(Communication) between computer systems on the Internet. REST-compliant web services allow the requesting systems to access and manipulate textual representations of web resources by using a uniform and predefined set of stateless operations.

It was introduced by Roy Fielding in his 2000 PhD dissertation “Architectural Styles and the Design of Network-based Software Architectures”.

Wikipedia defines REST in very crispy way as below:

Representational State Transfer (REST) term is intended to evoke an image of how a well-designed Web application behaves: it is a network of Web resources (a virtual state-machine) where the user progresses through the application by selecting links, such as /user/tom, and operations such as GET or DELETE (state transitions), resulting in the next resource (representing the next state of the application) being transferred to the user for their use. By using a stateless protocol and standard operations, REST systems aim for fast performance, reliability, and the ability to grow, by re-using components that can be managed and updated without affecting the system as a whole, even while it is running.

Six principles of REST:

REST provides six guidance principles or constraints which must be satisfied if an API is called as RESTFul API. Those principles are as below:

  1. Client–server architecture
  2. Statelessness
  3. Cacheability
  4. Uniform interface
  5. Layered system
  6. Code on demand

Client–server architecture:

You request for available flight details from an Airlines provider on internet. At high level you are a client who is requesting data from an Airlines provider (Server) over HTTP. It is called Client-server architecture. It separates Client and Server related things. You can request airlines details from multiple platforms. Separating user interface concerns from the data storage concerns improves the portability of the user interface across multiple platforms improve scalability by simplifying the server components.

Statelessness:

In client-server architecture, server does not save any information about client between requests. Every request to server from any client must contain all required information so that server can understand and response with proper response. It does not matter if same client is sending request to same resource multiple times. Session state is therefore kept entirely on the client.

Cacheable:

We know response is returned by server on request of client. This response may be cacheable which helps in reusing data for later equivalent requests. Well-managed caching partially or completely eliminates some client–server interactions, further improving scalability and performance. A REST API should be designed to encourage the storage of cacheable data.

Uniform interface:

Client-server architecture separates or decouples the the architecture, which enables each part to evolve independently. Changes at either architecture, will not impact others. REST is defined by four interface constraints: identification of resources; manipulation of resources through representations; self-descriptive messages; and, hypermedia as the engine of application state.

Layered system:

In Client-server architecture , we generally see two layers but in fact there are so many layers with some responsibilities in between request and response. These Intermediary servers/layers can improve system scalability by enabling load balancing and by providing shared caches. They can also enforce security policies.

Code on demand:

This is an optional constraints which allows for code or applets or client-side scripts such as JavaScript to be transmitted via the API for use within the application.

More about API Testing in upcoming posts. Stay tuned.

If you have any doubt, feel free to comment below. If you like my posts, please like, comment, share and subscribe. #ThanksForReading

#HappyApiTesting

Uncategorized

Post navigation

Previous Post: Part 12: Usages Of Javascripts In Selenium : How To Type In Input Box Using Javascript
Next Post: REST Assured Tutorial 48 – How To Pass Headers In Rest Assured Requests

Related Posts

October 22, 2017 – Make Selenium Easy Uncategorized
REST Assured Tutorial 75 – What Is Serialization And Deserialization In Rest Assured? Uncategorized
Git Tutorial 2 – What is GIT and Its Advantages? Uncategorized
Bedsheets – Make Selenium Easy Uncategorized
Frequently Asked Java Program 06: Print a Floyd Triangle of given number of rows Uncategorized
May 2018 – Page 3 – Make Selenium Easy Uncategorized

Recent Posts

  • Getting Started with Selenium 4: What Is New and How to Upgrade from Selenium 3
  • Manual Testing
  • Baby Steps To Become Efficient Selenium-Java Automation Tester
  • Features of Selenium 4.0.0 Release – Java Binding
  • Part 1: Handling Drop-down Created Using SELECT Tag In Selenium

Recent Comments

No comments to show.

Archives

  • April 2026
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • April 2024
  • March 2024
  • February 2024
  • December 2023
  • October 2023
  • August 2023
  • November 2022
  • September 2022
  • August 2022
  • July 2022
  • May 2022
  • March 2022
  • October 2021
  • April 2021
  • March 2021
  • January 2021
  • December 2020
  • October 2020
  • September 2020
  • August 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • May 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • January 2018

Categories

  • Getting Started
  • Uncategorized

Copyright © 2026 Make Selenium Easy.

Powered by PressBook Masonry Dark