Note: If you are looking for certificates based api call security then you can read How to implement SSL Pinning in your Flutter App
In this tutorial i will use dio library for HTTP calls.
So if we call
/restaurant/all api without cookie then it will give error. So we have to call login api first, and we will get Cookie from response header of login api. And after that we can use that Cookie in request header of next api.