What is RESTful API?
RESTful API is an application program interface (API) that uses HTTP requests to GET, PUT, POST and DELETE data. It also referred to as a RESTful web service which is based on Representational State Transfer (REST) technology, an architectural style and approach to communication often used in web service development.
REST technology is generally preferred than Simple Object Access Protocol (SOAP) technology, because it leverage less bandwidth, making it more suitable for internet usage.
With rising of use of cloud services, APIs are emerging to expose web service because REST is a logical choice for building APIs that allow users to connect and interact with cloud services. RESTful APIs are used by popular websites as Amazon, Google, LinkedIn and Twitter.
How RESTful APIs work?
A RESTful API breaks down a transaction to create a series of small modules. Each module addresses a particular underlying part of the transaction. This modularity provides developers with a lot of flexibility, but it can be challenging for developers to design from scratch.
A RESTful API explicitly takes advantage of HTTP methodology. They use GET to retrieve a resource; PUT to change the state of or update a resource, which can be an object, file and blocks; POST to create that resource; and DELETE to remove it.
REST is useful in cloud applications. Stateless components can be freely redeployed if something fails, and they can scale to accommodate load changes. This is because any request can be directed to any instance of a component; there can be nothing saved that has to be remembered by the next transaction. That makes REST preferred for web use, but the RESTful model is also helpful in cloud services because binding to a service through an API is a matter of controlling how the URL is decoded.