Our REST API is working great with a collection of endpoints that a client can send requests to.
In this chapter, we'll do something outside-of-the-box, ehem send requests to "outside our box" 🥁😅 Let me explain...
Our server will be the "client" which sends requests to external services, like Public APIs.
🙋♀️ Isn't mLab a public API?
→ mLab is external, but we used mongo
library to abstract the requests and responses made to the database
How our server communicates with a public API is exactly the same as how our client communicates with our server: through HTTP requests that we know, like GET and POST 🤓
For example:
Public APIs require varying levels of authentication: