I’m sorry in advance I don’t have a friend to ask this newbie question
I’m new and still learning all about API and in my way of learning it I already imagine
what I’m going to build, like that child on Twitter who monitor where the plane of mr beast
goes to but how to automatically get the updated API flight, do I need hard code it every time?
>Solution :
You can do it in two ways I think.
First, you can request the API (like GET: myApi.com/flights) every X seconds, get the data and update your app. Note that this method can be very heavy in term of data width and bandwidth.
This method is called Long-polling.
The other method is to use websockets, wich is a way to synchronize your app and an API without having to request it every X seconds.
You simply create a tunnel between your app and the API, and push messages on it. The app on the other side of the tunnel is constantly listening and is available to handle the messages (with some code you have written).