REST Concepts and Features: Core Technology for Web Services

·

3 min read

Definition

REST (Representational State Transfer).

Rules the way data is exchanged between different devices or systems.

  1. Identification through unique HTTP URI (Uniform Resource Identifier)

  2. Use of HTTP methods (POST, GET, PUT, DELETE, PATCH, etc.) to read, modify, and delete the corresponding resource (CRUD operation)

Resource

In the HTTP protocol, a resource refers to any information or object that can be identified and requested through a unique URI (Uniform Resource Identifier).

Examples of resources include web pages, images, videos, audio files, documents, and other types of data that can be accessed via HTTP on the internet.

CRUD Operation

A term that refers to the basic data processing functions of creation, retrieval, updating, and deletion.

  1. Create (POST): Data creation

  2. Read (GET): Data retrieval

  3. Update (PUT, PATCH): Data modification

  4. Delete (DELETE): Data deletion

Characteristics of REST

  1. Server-Client Structure: The server-client structure refers to the structure between the client that requests the service and the server that provides the service on the network. The client sends a request to the server, and the server responds to the request. This structure is commonly used in internet and web technologies and is also used in various fields such as distributed systems and cloud computing.

  2. Stateless: Stateless refers to the server not storing the client's previous request contents. This allows the server to process each request independently and ensure that each request does not affect each other. This reduces server load and increases scalability.

  3. Cacheable: Cacheable means that the server's response can be stored by the client or intermediate servers. This enables faster response times and less bandwidth usage by using the stored data instead of requesting the data or resources previously requested.

  4. Layered System: A layered system allows for intermediate servers between the server and client, and these servers process requests and responses independently. This reduces the coupling between the server and client and increases the system's flexibility and scalability.

  5. Uniform Interface: Uniform interface refers to the need for a consistent interface design between the server and client. This enables the communication between different systems, allows each component of the system to be changed independently, and allows for the addition of new technologies or features without the need to change the entire system.

Pros and Cons of REST

Advantages

  • Uses the HTTP protocol infrastructure, eliminating the need for separate infrastructure for REST API use.

  • Uses HTTP protocol standards to take advantage of additional benefits.

  • Can be used on all platforms that follow the HTTP standard protocol.

  • REST API messages indicate their intent, making it easy to understand what they are intended to do.

  • Minimizes problems that may arise from different service designs.

  • Separates the roles of the server and client.

Disadvantages

  • No existing standard, so a definition is required.

  • HTTP methods are limited in form.

  • If a service requires a lot of testing through a browser, it requires the processing of header information rather than easily modifiable URLs, requiring specialized knowledge.

  • Many behaviors are not supported by older browsers such as Internet Explorer.

Did you find this article valuable?

Support Han by becoming a sponsor. Any amount is appreciated!