REST API - what is it? REST: translation. Representative state transfer

REST API (Representational State Transfer), or RESTful web services - what is it? REST translated from English "representative state transfer". This is a way to ensure interoperability between computer systems on the Internet. REST-compatible web services that allow requesting systems to access and manage textual representations of web resources using a single and predefined set of operations. There are other forms of web services that contain their own arbitrary sets of operations, such as WSDL and SOAP.

REST API: what is it? Definition of a concept

Web resources were originally defined on the World Wide Web as documents or files identified by their URLs. Today they have a much more general and abstract definition encompassing every object or entity that can be identified, named, addressed, or processed on the Web. In the REST API web service, requests poisoned in a resource URI cause a response that can be in XML, HTML, JSON, or in some other format. The answer may confirm that some changes have been made to the stored resource, and also provide hypertext links to other related resources and their collections. Using HTTP as the most common protocol refers to the types of operations that are available, which are predefined by the PUT, DELETE, HTTP GET, POST commands.

Using stateless protocols and standard operations, REST systems aim for fast performance, reliability, and growth through the reuse of components that can be managed and that can be updated without affecting the system as a whole. Using REST is often preferred over the heavier Simple Object Access Protocol (SOAP) style because REST does not use bandwidth, making it more suitable for use on the Internet. The SOAP approach requires the recording or use of the provided server program (for serving data) and the client program (for querying data).

rest api what is it

History of technology

The term "representative state transfer" was introduced and defined in 2000 by Roy Fielding in his dissertation, "Architectural Styles and Design of Network Software Architectures." He developed the REST architectural style in parallel with 1996-1999 HTTP 1.1, based on the existing 1996 HTTP 1.0 project. In a retrospective look at the evolution of technology, Fielding said that over the course of the HTTP standardization process, he was called upon to defend design choices on the Internet. This is a very difficult task in the process of accepting offers from someone on a topic that is quickly becoming the center of the entire industry.

Fielding had comments from over 500 developers, many of whom are excellent engineers with years of experience. He had to explain everything from the most abstract concepts of web interaction to the exact details of the HTTP syntax. This process honed his model to a basic set of principles, properties, and limitations, now called REST.

rest api authorization

Benefits

Features of the REST style affect the following architectural properties:

  • Performance - The interaction of components is the dominant property in users' perception of network performance and effectiveness.
  • Scalability to support the maximum number of components, testing the REST API and the interaction between them.
  • The simplicity of a single interface and authorization REST API.
  • Modifiability of components to meet changing needs (even while the application is running).
  • Visibility of communication between components and service agents.
  • The ability to transfer components by moving their program code with data.
  • Reliability - high fault tolerance in the presence of failures in the composition, connectors or data.

rest translation

The separation of problems between clients is explained by the fact that this REST API allows to simplify the implementation of components, reduces the complexity of the connector semantics, increases the efficiency of performance tuning and increases the scalability of pure server components. Complex system restrictions allow proxy intermediaries, gateways, and firewalls to be deployed at different points of communication without changing the interfaces between the components, which allows them to REST-translate messages or improve performance using large-scale shared caching. An example of a REST API is the fact that the interaction does not depend on the state of the requests, standard methods and types of media are used to indicate semantics and information exchange, and the responses clearly indicate cacheability.

Formal and architectural constraints

Six guiding limitations characterize the RESTful system. They limit the ways in which the server can process and receive client requests. Acting within the framework of these restrictions, the service receives the desired non-functional properties, such as performance, scalability, simplicity, variability, visibility, mobility and reliability. If the service violates any required restrictions, it cannot be considered RESTful.

The first restrictions relate to the client-server architectural style. Sharing user interface problems with storage issues improves portability of the user interface across multiple platforms. It also improves scalability by simplifying server components. Perhaps most significant for the Web, the separation allows the components to evolve independently, thereby supporting the requirements of the Internet-scale for many organizational domains.

representational state transfer

Security

REST does not provide native security support. This is very important when designing REST web services β€” security and design requirements are met in advance. REST web services use HTTP GET, POST, PUT, and DELETE from CRUD operations. PUT and DELETE are not supported by many browsers and are most often disabled at the server level due to a possible privacy violation. If it is not configured properly at the server and client level, any unauthorized user can create a resource using the PUT method or destroy the DELETE resource used. When developing security requirements for web services, these points should be considered.

rest api examples

Architectural elements

A key aspect of REST is the nature and state of its data elements. In the REST style, there are four concepts that describe the behavior and state of information.

A resource is an object (logical or physical) available on the Internet. This can be a document stored in the server file system or a row in the database table. The end user interacts with the resource to achieve a specific goal. To design a system using REST, a developer must think about business objects as resources and how they can be addressed.

rest api java

URI - uniquely identifies a resource. This parameter makes the resource addressable and can be changed. Resources are modified using an application protocol such as HTTP.

A view is data / metadata about the state of a resource at a point in time. The client gets a representation of the resource when requesting a URI. The type of resource can be encoded in one or more transmitted formats, such as XML, HTML, JSON, RSS, REST API java. These formats can be harmonized using a content matching mechanism.

Link - allows the application to transition from one state to another. Each resource must be connected to other resources. The view should offer a link to the next transition. A well-connected application allows the user to open the interface on their own.

Connector

A connector connector is an abstract interface that mediates communication between components. Because REST interactions are stateless, the connector does not need to store state information. Therefore, the connection between the components can occur in parallel.

rest api requests

Client and server are the main REST connectors. The client initiates the request, and the server processes it.

Cache is another type of connector. Caching can be implemented at client, server or intermediate levels. This reduces latency and network usage.

Components

Components perform a set of well-defined methods on a resource that creates a view to capture the current or intended state.

User-Agent - Uses a client connector to initiate a request.

Origin server - uses a server connector to respond to a request.

A proxy is a proxy that is used on the client side to provide encapsulation of the interface by other services. It also performs data transfer and protection.

A gateway is an intermediary used on a server to provide encapsulation of an interface by other services.

Development prospects

The question is always relevant: REST API - what is it for modern Internet technologies? REST is the foundation of modern web architecture, which is developed by analyzing the shortcomings of existing styles and introducing new additions to it.

REST API goals - what is it? It seeks to leverage existing styles with a coordinated set of constraints to minimize network connectivity and maximize the independent evolution of components to achieve scalability. This is the new architecture of the distributed hypermedia system . With the advent of smartphones, tablets, etc. gadgets, the network and its scalability will be introduced.

Source: https://habr.com/ru/post/C3628/


All Articles