Articles

One of the core things I’ve been working on for the past 10 years is APIs — everything from simple APIs that are used by one client to multi-device and multi-purpose APIs. During those years, I’ve also had the opportunity to work with many third-party APIs like Stripe, Twilio, and others who are less popular and glamorous. Almost all of those APIs were REST-based and unique in some way. 

There are many reasons why REST is so popular. It’s simple to understand, it’s flexible, it works on any scale, it has a great community and tools built around it. But besides those, I’d also say that a lot of popularity came from the fact that’s its oldest rival, SOAP, is just horrible.

Source de l’article sur DZONE


Defining a resource

Fielding’s dissertation describes a Resource as:

"Any information that can be named" … "a document or image, a temporal service (e.g. “today’s weather in Los Angeles”), a collection of other resources, a non-virtual object (e.g. a person), and so on. In other words, any concept that might be the target of an author’s hypertext reference must fit within the definition of a resource. A resource is a conceptual mapping to a set of entities, not the entity that corresponds to the mapping at any particular point in time."

Defining a resource is both a science and an art. It requires both domain knowledge and API architectural skills. The following points detailed below serve as a checklist that may help you determine the shape of your resource, what data it should contain, and how it should be presented to consumers of your API.

Source de l’article sur DZONE