data-driven-docs

Selft training repo


Project maintained by ggranados Hosted on GitHub Pages — Theme by mattgraham

RESTful Architecture


Table of Contents


What is REST?

REST stands for “Representational State Transfer.” It is an architectural style and set of constraints used in designing and structuring networked applications, particularly web services and APIs.

REST is commonly used to build distributed, stateless and reliable Web-based systems that allow different software components to communicate over a network, typically the internet.

This architectural style emphasises the scalability of interactions between components, uniform interfaces, independent deployment of components, and the creation of a layered architecture to facilitate caching of components to reduce user-perceived latency, enforce security, and encapsulate legacy systems.

Back to top

Architectural constraints

REST defines six guiding constraints. When these constraints are applied to the system architecture, it gains desirable non-functional properties, such as performance, scalability, simplicity, modifiability, visibility, portability, and reliability

Back to top

Back to top

Back to top

Back to top

Back to top

Back to top

Back to top

HTTP Fundamentals

HTTP stands for “Hypertext Transfer Protocol.” It is the fundamental protocol that underpins data communication on the World Wide Web. HTTP is an application layer protocol used for transmitting various types of data, such as HTML documents, images, videos, and other resources, between a client (typically a web browser) and a server (hosting websites and web applications).

-See also HTTP & HTTPS

Back to top

HTTP Verbs

HTTP defines several methods that indicate the desired action to be performed on a resource. The most commonly used methods in REST are:

Back to top

URI (Uniform Resource Identifier) and URL (Uniform Resource Locator)

URIs are used to uniquely identify resources. In RESTful APIs, URIs are used to address resources, and they should be designed to be meaningful and hierarchical. For example:

```http request GET /api/users/123


URL (Uniform Resource Locator): A URL is a specific type of URI that not only identifies a resource but also provides the means to locate it. It includes the information needed to access a resource, such as the _protocol_ (e.g., HTTP), _domain name_, _port number_, _path_, and _query parameters_. URLs are used to specify the location of web pages, images, files, and other resources on the internet. For example:

```thymeleafurlexpressions
https://www.example.com:8080/products?id=123&page=1#details

Back to top

Request and Response Headers

HTTP headers contain additional information about the request or response. Some important headers in REST include:

Back to top

HTTP Status Codes in REST

HTTP status codes are three-digit numbers sent by the server in response to a client’s request. They provide information about the outcome of the request. Common status codes in REST include:

Back to top


Ref.


Get Started | Web Services and API Design