I was surprised to see APIs compared to contracts. Then my surprise led me to attempt to concoct my own analogy: a librarian.
An API is like a super fast, digital librarian. The librarian oversees all of the library's contents (AKA books in this metaphor). When we, the API user, send a GET request, we a asking that API librarian to "get" us a particular book (i.e. piece of info). I think this analogy even works for PUT | POST | DELETE requests, but in those instances you (the user) are acting more like the library owner instead of a library customer, since you are getting to make decisions about the books that the library keeps in stock.
Freelance tech writer and community-builder Self-teaching web development/design, using online resources. Blogs about JavaScript, mindset, and my journey.
I was surprised to see APIs compared to contracts. Then my surprise led me to attempt to concoct my own analogy: a librarian.
An API is like a super fast, digital librarian. The librarian oversees all of the library's contents (AKA books in this metaphor). When we, the API user, send a GET request, we a asking that API librarian to "get" us a particular book (i.e. piece of info). I think this analogy even works for PUT | POST | DELETE requests, but in those instances you (the user) are acting more like the library owner instead of a library customer, since you are getting to make decisions about the books that the library keeps in stock.
I love this analogy, great job!!!
Happy to lend the assist :)