Monday, July 1, 2019

API Testing 04: Introduction to REST architecture

History of REST:

REST web services were first introduced by Roy Fielding in 2000 at University of California. He submitted a thesis on developing web services using HTTP protocol with some principles.

The web services developed using HTTP protocol and binding to the principles of Roy Fielding are called RESTful web services.

REST stands REpresentational State Transfer. Some of the principles of Roy are discussed below:

Client -server:

A web services should be build in client - server architecture style, where the client will be sending the request and server will be providing the required information as response.

In an application the client (GUI)  should be separated from the back-end (Database or any data source), So that the client and server become independent each other.

When client and server becomes independent each other, multiple clients can interact with a server and client or server can evolve further in different technologies.

Representational:

A RESTful web service should support or represent multiple data formats like XML, JSON, Txt and etc.

Which means it should be able to understand and process all the data formats. Since the web service is representing multiple data formats and serving multiple clients it is said to be REpresentational style.

State Transfer or Stateless:

The client and server know each other during the request-response period only, once the request is processed they will know longer recognize each other. That is no information of client is stored on server, every time the client will be a new client to it. So they do not the state of each other once request processed, so it is said to be connection less or Stateless.

When we are accessing a source on the server using URI or URL, the web service should be able retrieve the state of source at that particular instant, and do not fix the data that needs to be retrieved in the source.

If the source gets updated the state of source will be changed and the web service should be able to retrieve updated state of the source in the new instant, since the web service is transferring the state of the source present on the server every time it is State Transfer.

REST APIs Design:

When we say RESTful web service, it means two REST APIs of client and server are communicating with each other over internet. Client and Server will have different APIs for different purposes. When invoked a REST API from client machine in any communication corresponding REST API will respond on the server machine.

In Web Service, client and server are nothing but applications. Lets understand this with an example:



Thanks for reading. This is how REpresentational State Transfer or REST web services are derived. Hope you got basic understanding about REST background.

#HappyLearning #HappyTesting

No comments:

Post a Comment

DevOps 01: What is DevOps and How it benefits organizations?

DevOps is a culture in an organization, where the development team and operations team help each other by sharing information, process and t...