In this short article you are going to have a general idea about what is REST API and how REST API works
First, what API Is In General
So first let’s talk what API is in general it stands for Application Program Interface.
There many kinds of API but we are going to talks specific about web API it is a contract provided by one piece of software to another piece of software usually consist of structured request and then structured response.
A good example would be an API is basically a messenger or a waiter between running softwares
Think like you are setting in a table in a restaurant and your one piece of software such as web application on the client side, and the kitchen is the server or the service that processes certain request and the waiter is acts like an API he is formatted to take certain order in specific way and bring back a certain meal that would be the data and response you requested.
What is REST API ?
So now that we know what API is so let’s talk about REST API.
It stands for Representational State Transfer it is an architecture style for designing network applications it works for relying on a stateless client-server communication protocol in almost all cases it is going to be HTTP
So now that we established what REST API is let’s look at specific methods and request that can be made to a server through HTTP.
- GET: Retrieve data from a specified resource
- POST: Submit data to be processed to a specified resource
- PUT: Update a specified resource
- DELETE: Delete specified resource
- HEAD: Same as GET but does not return body
- OPTION: Returns the supported HTTP methods
- PATCH: Updated partial resources