REST API
Q) What is REST API?
Weather report app data keeps changing
with time, how do we change the data?
The idea is all over the globe you have to
put sensors, otherwise you wont have data.
This is a very tedious task which we
obviously wont do.
Luckily we have some web services on the
internet that will give us this data, these
servers will give you the data and this
server may belong to some company.
API is basically something that will connect
you and that server.
REST says what if you create an object on
the server side and just have it to return the
object itself.
What we’re transferring is not the object but
the state of the object, that can be sent
using JSON or XML.
HTTP METHODS
HOW REST API WORKS?
✅ The server has all the data stored in a
database.
✅ The client (your app, website, or
game) needs that data.
✅ The REST API acts as a middleman
that:
Fetches data from the server
Converts it into a structured format
(JSON/XML)
Sends it back to the client