RESTful APIs
What is an API built with REST in mind?
RESTful APIs are desiged following the REST -Representational State Transfer- architectural style. An API that is designed with REST in mind, has to conform to a set of constraints defined by the following criteria:
- There must be a separation of concerns, defined by the client-server relationship, and both entities can be idependently implemented.
- The system is stateless, meaning each entity does not know or need to know about the state of the other party at any time, since there is no session information stored.
- All responses should be cacheable, to enhance performance, although responses may be marked as non-cacheable, when required.
- The system is built in the form of layers, an no party is aware at any time, if they’re receiving a response directly from the data source, or a proxy.
- Servers are extensible via additional executable code, sent with a response.
- An additional constraint requires a uniform interface to manipulate and handle resources, hypermedia, metadata and other messages sent in the response.
To this day, RESTful APIs are the most extensively used architecture paradigm in API design for web development. A recent poll on twitter by Matteo Collina confirmed that over 70% of the respondents still prefer or use RESTful APIs in their projects.