The lie of the API | Ruben Verborgh
▻http://ruben.verborgh.org/blog/2013/11/29/the-lie-of-the-api
Futuristic? It’s not: it works already, and it’s really simple. Here is a designer chair from the Cooper-Hewitt museum:
▻http://collection.cooperhewitt.org/objects/35460799
The cool thing is that machine clients use the same URL to access a JSON version:
curl ▻http://collection.cooperhewitt.org/objects/35460799 -H “Accept: text/html”
curl ▻http://collection.cooperhewitt.org/objects/35460799 -H “Accept: application/json”
Not only does this enable to share URLs between different parties, it also makes access really simple. I don’t have to read the manual. Instead, I just use the same interface I use every day: the URL. Works the same way everywhere.
This technique is called content negotiation and it is a characteristic of REST APIs.
Voui voui voui. Chouette article qui met la pile aux gens qui compliquent à loisir.