Native app creators hate this guy - abukhalil-LTUC-ASAC/amman-401d4 GitHub Wiki
REST your web problems away with this one trick
By following the guidelines, mostly the ones concerning REpresentational State Transfer architecture really, which are:
1- Client–server as in separating how data is processed into two semi-independent components.
2- Stateless as in all data that is ever requested is done so in a single swoop of a request, and not relying on outer logic from the server to handle client side states.
3- Cacheable as in the same requests are done once, by saving them on the client side if tagged as cacheable.
4- Uniform interface is a software engineering principle that contains some constraint about how a UI is made, these are:
-
Identification of resources or the ease to do so.
-
Self-descriptive messages, should be self descriptive enough.
5- Layered system allows for a contained show and use of information and methods such as each layer won't be able to see or use beyond what it contains.
6 - Code on demand allows user sided script execution, something you could see with wordpress web apps that has both simplified and code based solutions.
Making use of resources
Whatever you would want to send or receive through an API, is identified by a representation, and its format is called Media type, these representations apply to the state of the concerning resource, including the data, meta data and hypermedia links, the media type shows the endpoint how the representation should be handled.
How to make use of resources
Using Resource Methods ofcourse! Which have been famously handled before, as GET/PUT/POST/DELETE
methods.
The only restriction would be that:
Ideally, everything that is needed to change the resource state shall be part of API response for that resource – including methods and in what state they will leave the representation.
Just dont forget REST != HTTP
"Though, because REST also intends to make the web (internet) more streamline and standard, he advocates using REST principles more strictly. And that’s from where people try to start comparing REST with web (HTTP). Roy fielding, in his dissertation, nowhere mentioned any implementation directive – including any protocol preference and HTTP. Till the time, you are honoring the 6 guiding principles of REST, you can call your interface RESTful.
In simplest words, in the REST architectural style, data and functionality are considered resources and are accessed using Uniform Resource Identifiers (URIs). The resources are acted upon by using a set of simple, well-defined operations. The clients and servers exchange representations of resources by using a standardized interface and protocol – typically HTTP."