RESTful Web Services - Introduction

REST stands for REpresentational State Transfer. REST is a web standards based architecture using the HTTP protocol. It revolves around a resource where each component is a resource and the resource is accessed through a common interface using standard HTTP methods. REST was first introduced by Roy Fielding in 2000.
In a REST architecture, the REST server simply provides access to the resources, and the REST client accesses and modifies the resources. Here, each resource is identified by URIs / global identifiers. REST uses different representations to represent resources like text, JSON, XML. JSON is the most popular.
HTTP Methods
The following four HTTP methods are commonly used in a REST-based architecture.
-
GET - Provides read-only access to a resource.
-
POST - used to create a new resource.
-
DELETE - used to delete a resource.
-
PUT - used to update an existing resource or create a new resource.
GET - Provides read-only access to a resource.
POST - used to create a new resource.
DELETE - used to delete a resource.
PUT - used to update an existing resource or create a new resource.
Introduction to RESTFul Web Services
A web service is a set of open protocols and standards used to exchange data between applications or systems. Software applications written in different programming languages ​​and running on different platforms can use web services to communicate over computer networks such as the Internet, similar to inter-process communication on a single computer. This compatibility (for example, between Java and Python applications, or Windows and Linux) is due to the use of open standards.
Web services based on REST architecture are known as RESTful web services. These web services use HTTP methods to implement the REST architecture concept. A RESTful web service typically defines a URI, the service's Uniform Resource Identifier, provides a resource representation such as JSON, and a set of HTTP methods.
Creating a RESTFul Web Service
In the following chapters, we will create a web service, say user management, with the following features: