/
rest.xml
42 lines (34 loc) · 3.1 KB
/
rest.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:w="tag:fullstack.wiki,2018:ns/" lang="en" dir="ltr">
<head>
<meta charset="UTF-8" />
<title>REST (Representational State Transfer)</title>
<meta name="description" content="REST (Representational State Transfer) is the networked application architecture that underlies the Web" />
</head>
<body>
<main>
<h1>REST (Representational State Transfer)</h1>
<p>REST (Representational State Transfer) is a networked, client-server application architecture that allows operations on resources. It is the formal definition that underlies the World Wide Web and influences the design of Web technology including HTTP, the URI, and HTML.</p>
<p>It is one of several networked application architectures defined in a <a href="https://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm">Ph.D. dissertation by Roy T. Fielding</a>, an editor on the HTTP specification.</p>
<p>REST is often used to describe a property of API designs, this is called a RESTful API. REST more accurately describes how Web browsers and Web servers work together.</p>
<h2>Properties of a RESTful Application</h2>
<p>When an application architecture adds a constraint, it also gains useful features since other parts of the applications may make useful assumptions about how the application will behave.</p>
<p>For example, a constraint of the Web is that a GET request is "safe" and does not change the state of the application (in a visible way). The benefit of this is that users may make GET requests without worrying they may change the state of the server.</p>
<p>REST is an application architecture of six such constraints:</p>
<h3>Client-Server</h3>
<p>A client-server architecture is one of the key constraints that enforces separation of concerns. A single <i>server</i> retains data, and a <i>client</i> presents the interface around interacting with the data. The client is <i>portable</i>, and may be physically or logically separate from the server.</p>
<h3>Stateless</h3>
<p>All communication must be stateless—each request must carry all the information necessary to process the request.</p>
<h3>Cache</h3>
<p>Caching allows for better network efficiency, by allowing servers to communicate when a resource from a previous request may be re-used in the future. For individual nodes, it is a feature.</p>
<h3>Uniform Interface</h3>
<p>The uniform interface means that a generic user agent is able to make use of the data on any server, without any prior knowledge of what the server does or how it operates.</p>
<h3>Layered System</h3>
<p>A layered system allows an application to be composed of multiple, hierarchical layers of nodes, for example caches, gateways, delivery networks, or proxies.</p>
<h3>Code-On-Demand</h3>
<p>Code-on-demand allows servers to ship a program that clients may run to make additional use of the data in a response. For individual nodes, it is a feature. Servers and clients may or may not decide to use code-on-demand.</p>
<h3>Overview</h3>
<p><img src="rest_derivation.svg" /></p>
</main>
</body>
</html>