Skip to content

REST

Also called: RESTful, REST API, representational state transfer

Published:

Which constraints make up REST?

Fielding set out REST in his 2000 doctoral dissertation at the University of California, Irvine [3]. Its fifth chapter introduces the style for distributed hypermedia systems [1]. The constraints are client-server separation, statelessness (each request carries everything the server needs), cacheability, a uniform interface, a layered system and, optionally, code on demand [1].

MDN describes these constraints as the ones that bring about efficient, reliable and scalable distributed systems. A service that follows them is called RESTful [2].

What does a uniform interface mean?

Fielding treats the uniform interface as the central feature that sets REST apart, and defines it through four constraints: identification of resources, manipulation of resources through representations, self-descriptive messages, and hypermedia as the engine of application state [1].

A representation is a sequence of bytes plus metadata describing those bytes [1]. For example, when a client asks for a resource identified by a URL, the server sends not the resource itself but a representation of it, such as an HTML document or a JPEG image [1].

Is every HTTP API a REST API?

No. MDN points out that HTTP APIs are often casually called RESTful APIs or REST services even when they do not follow all of REST's constraints [2]. In everyday use, "REST API" usually just means an HTTP service you can call with standard web libraries and tools [2].

Frequently asked questions

Is REST a protocol?

No. REST is an architectural style, a set of constraints. On the web it is usually applied over HTTP, but it is not a protocol itself.

What does REST stand for?

Representational State Transfer.

Sources

  1. Chapter 5: Representational State Transfer (REST) — Roy T. Fielding, University of California, Irvine
  2. REST - Glossary — MDN Web Docs
  3. Architectural Styles and the Design of Network-based Software Architectures — Roy T. Fielding, University of California, Irvine

Related terms