Over the last couple of decades, the internet has evolved at an incredible pace and has made it so that communication between machines or people is either instantaneous or very fast. But while we have a lot of insight into the wonders of social media, we may not be as knowledgeable about the complex in which clients (browsers) and servers can interact without the client knowing anything beforehand about the server and the resources it hosts.
The sole constraint of this type of communication is that the server and client must both agree on the medium used, which in the case of the web is HTML. So what does this have to do with REST? To answer that question properly, we must first understand what REST is.
Representational State Transfer (REST) is described by Roy Fielding’s doctoral dissertation “Architectural Styles and the Design of Network-based Software Architectures” (2000) as a key architectural principle of the World Wide Web. Nowadays, REST is generally considered an approach to communications between two very different components that is often used in the development of a variety of web services.
Its decoupled architecture and lightweight communications makes it a powerful and convenient tool to build APIs. Those APIs are capable of sending HTTP requests to GET, PUT, POST and DELETE data. They use GET to retrieve a resource, PUT to change the state of or update a resource, POST to create that resource; and DELETE to remove it.
Decoupled architecture is a framework whereby two components (front-end services and back-end services) are allowed to remain completely autonomous and unaware of each other. As such, each component continues to work in its own style while an intermediary (REST) helps link the two components. So basically, a REST API consists of some specific values that can be in a format of XML or JSON, depending on what the function or program returns when the API is called.
With cloud use on the rise, APIs are emerging to expose web services. As a result, REST is the ideal choice for building APIs that allow users to connect and interact with cloud services. RESTful APIs are used by such sites as Amazon, Google, LinkedIn and Twitter.