RESTFUL API

Simge Ş.
4 min readMay 23, 2022

--

REST APIs are APIs that follows the principles of REST architecture and it is called RESTFUL API if all principles are supported.

UPS , lots of information in a sentence !

To understand better , we need to get to the bottom step by step :)

FIRST OF ALL, WHAT IS REST ?

REST is an architectural style of HTTP protocol for APIs and it stands for Representational State Transfer.

Hmm.. What the HTTP Protocol is ?

  • |If you want , you can give a shot below |

REST is abbreviation for REpresentational State Transfer. When client sends a request, server TRANSFERS to the client REPRESENTATION of the requested resource’s STATE.

Client is a person or software who uses an API. For instance, when we enter the URL we want to make changes to the web browser, the web browser becomes a client. The client browser calls an API and it uses the response data.

Resource is any object that client would like to have operation on.

URL example

Representational → When we click on any link, server delivers resources to browser. ACTUALLY server does not send database, it sends representation of that resource in readable format such as HTML, JSON, XML.
For example , in above URL server may show us an image which is a probably summer photo in JPEG format to be readable.

State → State is expressed in dictionary as “the particular condition that someone or something is in at a specific time.” For instance, in URL example we do not send request for whole site, it is only to call a state which is for an image. Also we may change the state by clicking on a button and there will be any other state in at specific time.

Transfer → Transfer is expressed in dictionary as “the movement of something or someone from one place, position, etc. to another”. In Rest architecture , transfer stands for movement of representational state from server to client.

So now, we know “REST” meaning ; we know what Representational , State, Transfer means and we know how client and server have roles in a transfer.

REST ARCHITECTURE

Do you remember the HTML scheme, which is linked above for another medium story? Does it look like REST architecture ? Yesss, REST uses the same scheme and here I want to give you the difference :

“IS REST THE SAME THING AS HTTP?

REST refers to a set of attributes of a particular architectural style, while HTTP is a well-defined protocol that happens to exhibit many features of a RESTful system. HTTP is not always RESTFUL.” So HTTP is a protocol and REST is a architecture which follows that protocol :)

As I mentioned before, basically there are request and response relation. So REST architecture has two main requirements :

  1. Method : Which operation we would like to do for resource
  2. End point : Which resource we would like to operate

Also header and parameters might be necessary depending on process.

Let’s go further a bit more :)

Method → When we create a communication between client and server, CREATE, READ, UPDATE, DELETE (CRUD) functions are the most common operations we might wanna do. REST architecture has equivalent POST, GET, PUT, DELETE respectively.

End point → It is a resource identifier to have performance on. There will be transfer of that endpoint’s representational state.

We are ready to ask WHAT IS RESTFUL API ?

REST API

REST APIs are APIs that follow the principles of REST architecture. They are called RESTful API if all principles are supported. I am not gonna ask what the principles are in this story :)

  • |In addition , you can check API writing to be clear more below |

Hopefully, you have enjoyed and this story is highly efficient for your purpose :)

https://www.baeldung.com/cs/rest-vs-http

IBM RESTful Web services: The basics,Alex Rodriguez,06 November 2008

--

--

Simge Ş.

Software Automation Test Engineer - ISTQB Certificated