REST API (Representational State Transfer), or RESTful web services - what is it? REST is translated from English as “representative state transfer”. It is a way of providing communication between computer systems on the Internet. REST-compliant web services that allow requesting systems to access and manipulate 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 set of operations, such as WSDL and SOAP.
REST API: what is it? Definition of 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 item or entity that can be identified, named, addressed or processed on the Web. In a REST API web service, requests poisoned into a URI-resource call a response, which can be formatted in XML, HTML, JSON, or some other format. The response can confirm that some changes have been made to the stored resource, and provide hypertext links to other related resources and their collections. The use of HTTP as the most common protocol refers to the types of available operations that are predefined by the PUT, DELETE, HTTP GET, POST commands.
Using stateless protocols and standard operations, REST systems aim for fast performance, reliability, and scalability by reusing components that can be managed and updated without affecting the overall system. Using REST is often preferred over the heavier SOAP (Simple Object Access Protocol) style because REST does not use bandwidth, making it more suitable for use on the web. The SOAP approach requires writing or using a provided server program (to serve data) and a client program (to request data).
History of Technology
The term "representational state transfer" was introduced and defined in 2000 by Roy Fielding in his dissertation "Architectural Styles and Design of Software Network Architectures". It developed the REST architectural style in parallel with HTTP 1.1 from 1996-1999, based on the existing 1996 HTTP 1.0 draft. In a retrospective look at the development of technology, Fielding said that throughout the processThe HTTP standardization was intended to protect design choices on the web. This is a very difficult task within the process of accepting proposals from anyone on a topic that is quickly becoming the center of the entire industry.
Fielding had comments from over 500 developers, many of whom are great engineers with years of experience. He had to explain everything from the most abstract concepts of web interaction to the precise details of HTTP syntax. This process honed his model to a core set of principles, properties, and constraints now called REST.
REST style features affect the following architectural properties:
- Performance - Component interaction is the dominant feature in user perception of network performance and effectiveness.
- Scalable to support the maximum number of components, REST API testing and interaction between them.
- Easy single interface and authorization REST API.
- Modifiable components to meet changing needs (even while the application is running).
- Visibility of connection between components and service agents.
- The ability to move components by moving their program code with data.
- Reliability - high fault tolerance in the presence of failures in the composition, connectors or data.
Due to the separation of concerns between clients in that this REST API allowssimplify the implementation of components, reduce the complexity of the connector semantics, increase the efficiency of performance tuning, and increase the scalability of pure server components. Sophisticated system constraints allow proxies, gateways, and firewalls to be deployed at different communication points without changing the interfaces between components, allowing them to perform REST message translation or improve performance with large-scale shared caching. An example of a REST API is the fact that interaction is stateless of requests, standard methods and media types are used to indicate semantics and information exchange, and responses explicitly indicate cacheability.
Formal and architectural constraints
Six guiding constraints characterize a RESTful system. They restrict the ways the server can process and accept client requests. By operating within these constraints, the service achieves desired non-functional properties such as performance, scalability, simplicity, variability, visibility, portability, and reliability. If the service violates any of the required restrictions, it cannot be considered RESTful.
The first restrictions relate to the client-server architectural style. Separating user interface concerns from data storage concerns improves the portability of the user interface across multiple platforms. It also improves scalability by simplifying server components. Perhaps most significant to the Web is that separation allows components to evolve.independently, thereby supporting the requirements of Internet scale for multiple organizational domains.
REST does not provide built-in security support. This is very important when designing REST web services - security and design requirements are met up front. 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 potential privacy concerns. If it is not configured properly at the server and client levels, any unauthorized user will be able to create a resource using the PUT method or destroy the DELETE resource in use. When developing security requirements for web services, these points should be taken into account.
A key aspect of REST is the nature and state of its data elements. There are four concepts in the REST style 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 on the server's file system or a row in a database table. An end user interacts with a resource to achieve a specific goal. To design a system with REST, a developer must think about business objects as resources and how they can be addressed.
URI - uniquely identifies a resource. This settingmakes the resource addressable and can be changed. Resources are modified using an application protocol - such as
View is the data/metadata of the state of a resource at a point in time. The client receives a resource representation when requesting a URI. The resource kind can be encoded in one or more transferable formats such as XML, HTML, JSON, RSS, REST API java. These formats can be negotiated using the content negotiation mechanism.
Link - Allows an 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.
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, communication between components can occur in parallel.
Client and server are the main REST connectors. The client initiates the request and the server processes it.
Cache is another kind of slot. Caching can be implemented at the client, server or intermediate levels. This reduces latency and network usage.
Components execute a set of well-defined methods on a resource that creates a view to capture the current or intended state.
User-Agent -uses the client connector to initiate the request.
Origin-server - uses the server connector to answer the request.
Proxy is an intermediary used on the client side to provide interface encapsulation by other services. It also performs data translation and protection.
Gateway - an intermediary used on the server to provide interface encapsulation by other services.
Prospects for development
The question is always relevant: REST API - what is it for modern Internet technologies? REST is the basis 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 is the desire to use existing styles with a coordinated set of constraints to minimize network communication and maximize the independent evolution of components to achieve scalability. This is a new architecture for a distributed hypermedia system. With the advent of smartphones, tablets, etc. gadgets, the network and its scalability will be introduced.