A web service is a client as well as a server application that is used to communicate over the World Wide Web's (WWW) via Hypertext Transfer Protocol (HTTP). According to the World Wide Web Consortium (W3C), the web services offer a regular way for interoperation between software applications that are running on various types of platforms as well as frameworks.
The REST Architecture
REST is the abbreviation of Representational State Transfer, a phrase coined in the year 2000 by Mr. Roy Fielding. It is a structural design approach for crafting loosely attached applications using HTTP, often implemented in the growth of web services. REST web services do not impose any rules concerning how it needs to be applied in practice at a low level; it only holds the high-level design guiding principles and leaves it to the developer to think about the implementation.
In this architecture, a REST server provides connectivity to resources, which helps with client access as well as updating resources. In this, the resources are recognized by the URIs / Global IDs. REST API creates a variety of outputs to represent a resource, such as JSON - which is very popular among them all, text, XML formats. REST architecture-oriented web services are termed as RESTful web services.
The REST architecture makes use of four commonly used HTTP methods. These are:
|GET||This method helps in offering read-only access for the resources.|
|POST||This method is implemented for creating a new resource.|
|DELETE||This method is implemented for removing a resource.|
|PUT||This method is implemented for updating an existing resource or creating a fresh one.|
These methods have been described in more detail in further chapters.