Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
REST
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Architectural style for client-server applications}} {{Other uses|Rest (disambiguation)}} {{pp-pc}} '''REST''' ('''Representational State Transfer''') is a [[software architectural style]] that was created to describe the design and guide the development of the architecture for the [[World Wide Web]]. REST defines a set of constraints for how the architecture of a distributed, [[Internet]]-scale [[hypermedia]] system, such as the Web, should behave. The REST architectural style emphasises uniform [[API|interfaces]], independent deployment of [[Software component|components]], the [[scalability]] of interactions between them, and creating a [[Multitier architecture|layered architecture]] to promote [[caching]] to reduce user-perceived [[latency (engineering)|latency]], enforce [[computer security|security]], and encapsulate [[legacy system]]s.<ref name="Fielding-Ch5">{{cite thesis |type=Ph.D. |first=Roy Thomas |last=Fielding |title=Architectural Styles and the Design of Network-based Software Architectures |chapter=Chapter 5: Representational State Transfer (REST) |publisher=University of California, Irvine |year=2000 |chapter-url=http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm |access-date=2004-08-17 |archive-date=2021-05-13 |archive-url=https://web.archive.org/web/20210513160155/https://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm |url-status=live }}</ref> REST has been employed throughout the software industry to create [[stateless protocol|stateless]], reliable [[web application|web-based applications]]. An application that adheres to the [[#Architectural constraints|REST architectural constraints]] may be informally described as ''RESTful'', although this term is more commonly associated with the design of [[HTTP]]-based [[API]]s and what are widely considered best practices regarding the "verbs" ([[Hypertext Transfer Protocol#Request methods|HTTP methods]]) a [[web resource|resource]] responds to, while having little to do with REST as originally formulated—and is often even at odds with the concept.<ref>{{cite web |author=Fielding |first=Roy T. |date=2008-10-20 |title=REST APIs must be hypertext driven |url=http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven |url-status=live |access-date=2016-07-06 |publisher=roy.gbiv.com |language=en-US |archive-date=2010-03-18 |archive-url=https://web.archive.org/web/20100318060707/http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven }}</ref> == Principle == The term ''representational state transfer'' was introduced and defined in 2000 by computer scientist [[Roy Fielding]] in his doctoral dissertation. It means that a server will respond with the representation of a resource (today, it will most often be an [[HTML]] document) and that resource will contain [[hypermedia]] links that can be followed to make the state of the system change. Any such request will in turn receive the representation of a resource, and so on. An important consequence is that the only identifier that needs to be known is the identifier of the first resource requested, and all other identifiers will be discovered. This means that those identifiers can change without the need to inform the client beforehand and that client and server must be inherently [[loose coupling|loosely coupled]]. == History == [[File:Roy Fielding at OSCON 2008.jpg|thumb|[[Roy Fielding]] speaking at [[O'Reilly Open Source Convention|OSCON]] 2008]] The Web began to enter everyday use in 1993–1994, when [[List of websites founded before 1995|websites for general use]] started to become available.<ref>{{cite book |last1=Couldry |first1=Nick |url=https://books.google.com/books?id=AcHvP9trbkAC&pg=PA2 |title=Media, Society, World: Social Theory and Digital Media Practice |date=2012 |publisher=Polity Press |isbn=9780745639208 |location=London |page=2 |access-date=2021-06-09 |archive-date=2024-02-27 |archive-url=https://web.archive.org/web/20240227165043/https://books.google.com/books?id=AcHvP9trbkAC&pg=PA2#v=onepage&q&f=false |url-status=live }}</ref> At the time, only a fragmented description existed of the Web's architecture, and there was pressure within the industry to agree on a standard for the Web interface protocols. For instance, several experimental extensions had been added to the communication protocol (HTTP) to support [[Proxy_server|proxies]], and more extensions were being proposed, but there was a need for a formal Web architecture with which to evaluate the impact of these changes.<ref name=":0">{{cite thesis |type=Ph.D. |first=Roy Thomas |last=Fielding |title=Architectural Styles and the Design of Network-based Software Architectures |chapter=Chapter 6: Experience and Evaluation |publisher=University of California, Irvine |year=2000 |chapter-url=https://www.ics.uci.edu/~fielding/pubs/dissertation/evaluation.htm |access-date=2023-06-21 |archive-date=2023-03-26 |archive-url=https://web.archive.org/web/20230326022001/https://www.ics.uci.edu/~fielding/pubs/dissertation/evaluation.htm |url-status=live }}</ref> The [[W3C]] and [[IETF]] [[Working_group#Technical_working_groups|working groups]] together started work on creating formal descriptions of the Web's three primary standards: [[URI]], [[HTTP]], and [[HTML]]. Roy Fielding was involved in the creation of these standards (specifically HTTP 1.0 and 1.1, and URI), and during the next six years he created the REST architectural style, testing its constraints on the Web's [[Software standard | protocol standards]] and using it as a means to define architectural improvements — and to identify architectural mismatches. Fielding defined REST in his 2000 PhD dissertation "Architectural Styles and the Design of Network-based Software Architectures"<ref name="Fielding-Ch5" /><ref>{{cite web |title=Fielding discussing the definition of the REST term |url=https://groups.yahoo.com/neo/groups/rest-discuss/conversations/topics/6735 |url-status=dead |archive-url=https://web.archive.org/web/20151105014201/https://groups.yahoo.com/neo/groups/rest-discuss/conversations/topics/6735 |archive-date=November 5, 2015 |access-date=2017-08-08 |publisher=groups.yahoo.com}}</ref> at [[University of California, Irvine|UC Irvine]]. To create the REST architectural style, Fielding identified the requirements that apply when creating a world-wide network-based application, such as the need for a low entry barrier to enable global adoption. He also surveyed many existing architectural styles for network-based applications, identifying which features are shared with other styles, such as caching and client–server features, and those which are unique to REST, such as the concept of resources. Fielding was trying to both categorise the existing architecture of the current implementation and identify which aspects should be considered central to the behavioural and performance requirements of the Web. By their nature, architectural styles are independent of any specific implementation, and while REST was created as part of the development of the Web standards, the implementation of the Web does not obey every constraint in the REST architectural style. Mismatches can occur due to ignorance or oversight, but the existence of the REST architectural style means that they can be identified before they become standardised. For example, Fielding identified the embedding of session information in URIs as a violation of the constraints of REST which can negatively affect shared caching and server scalability. [[HTTP cookies]] also violate REST constraints<ref name=":0" /> because they can become out of sync with the browser's application state, making them unreliable; they also contain opaque data that can be a concern for [[Internet privacy|privacy]] and [[Internet security|security]]. == Architectural properties == The REST architectural style is designed for network-based applications, specifically client-server applications. But more than that, it is designed for Internet-scale usage, so the coupling between the ''user agent'' (client) and the ''origin server'' must be as [[Loose coupling|loose]] as possible to facilitate large-scale adoption. The strong decoupling of client and server together with the text-based transfer of information using a uniform addressing protocol provided the basis for meeting the requirements of the Web: [[extensibility]], anarchic scalability<ref>{{cite thesis|title=Architectural Styles and the Design of Network-based Software Architectures|chapter=Chapter 4: Designing the Web Architecture: Problems and Insights|year=2000|publisher=University of California, Irvine|chapter-url=https://ics.uci.edu/~fielding/pubs/dissertation/web_arch_domain.htm|first=Roy Thomas|last=Fielding|type=Ph.D.|access-date=2025-01-28|url-status=live}}</ref> and independent deployment of components, large-grain data transfer, and a low entry-barrier for content readers, content authors and developers. [[File:REST information model.svg|centre|900px|thumb|An [[entity–relationship model]] of the concepts expressed in the REST architectural style]] The constraints of the REST architectural style affect the following architectural properties:<ref name="Fielding-Ch5" /><ref name="SOA with REST" /> * Performance in component interactions, which can be the dominant factor in user-perceived performance and network efficiency;<ref name="Fielding-Ch2">{{cite thesis|title=Architectural Styles and the Design of Network-based Software Architectures|chapter=Chapter 2: Network-based Application Architectures|year=2000|publisher=University of California, Irvine|chapter-url=http://www.ics.uci.edu/~fielding/pubs/dissertation/net_app_arch.htm|first=Roy Thomas|last=Fielding|type=Ph.D.|access-date=2014-04-12|archive-date=2014-12-16|archive-url=https://web.archive.org/web/20141216114322/http://www.ics.uci.edu/~fielding/pubs/dissertation/net_app_arch.htm|url-status=live}}</ref> * [[Scalability]] allowing the support of large numbers of components and interactions among components; * Simplicity of a uniform interface; * Modifiability of components to meet changing needs (even while the application is running); * Visibility of communication between components by service agents; * Portability of components by moving program code with the data; * Reliability in the resistance to failure at the system level in the presence of failures within components, connectors, or data.<ref name="Fielding-Ch2"/> == Architectural constraints == The REST architectural style defines six guiding constraints.<ref name="SOA with REST">{{cite book |last1=Erl |first1=Thomas |last2=Carlyle |first2=Benjamin |last3=Pautasso |first3=Cesare |last4=Balasubramanian |first4=Raj |date=2012 |chapter=5.1 |title=SOA with REST: Principles, Patterns & Constraints for Building Enterprise Solutions with REST |location=Upper Saddle River, New Jersey |publisher=Prentice Hall |isbn=978-0-13-701251-0 }}</ref><ref name="Richardson 2007">{{cite book |last1=Richardson |first1=Leonard |url=https://archive.org/details/restfulwebservic00rich_0 |title=RESTful Web Services |last2=Ruby |first2=Sam |date=2007 |publisher=O'Reilly Media |isbn=978-0-596-52926-0 |location=Sebastopol, California |language=en-US |url-access=registration}}</ref> When these constraints are applied to the system architecture, it gains desirable [[non-functional requirement|non-functional properties]], such as performance, scalability, simplicity, modifiability, visibility, portability, and reliability.<ref name="Fielding-Ch5"/> The formal REST constraints are as follows:<ref>{{Cite web |title=What is REST API? |url=https://www.visual-paradigm.com/guide/development/what-is-rest-api/ |access-date=2024-02-24 |website=www.visual-paradigm.com |archive-date=2024-02-24 |archive-url=https://web.archive.org/web/20240224173920/https://www.visual-paradigm.com/guide/development/what-is-rest-api/ |url-status=live }}</ref> * Client/Server – Clients are separated from servers by a well-defined interface * Stateless – A specific client does not consume server storage when the client is "at rest" * Cache – Responses indicate their own cacheability * Uniform interface * Layered system – A client cannot ordinarily tell whether it is connected directly to the end server, or to an intermediary along the way * Code on demand (optional) – Servers are able to temporarily extend or customize the functionality of a client by transferring logic to the client that can be executed within a standard virtual machine === Uniform interface === The uniform interface constraint is fundamental to the design of any RESTful system.<ref name="Fielding-Ch5"/> It simplifies and decouples the architecture, which enables each part to evolve independently. The four constraints for this uniform interface are: * Resource identification in requests: Individual resources are identified in requests using [[uniform resource identifier|URIs]]. The resources themselves are conceptually separate from the representations that are returned to the client. For example, the server could send data from its database as [[HTML]], [[XML]] or as [[JSON]]—none of which are the server's internal representation. * Resource manipulation through representations: When a client holds a representation of a resource, including any [[metadata]] attached, it has enough information to modify or delete the resource's state. * Self-descriptive messages: Each message includes enough information to describe how to process the message. For example, which parser to invoke can be specified by a [[media type]].<ref name="Fielding-Ch5" /> * Hypermedia as the engine of application state ([[HATEOAS]]) – Having accessed an initial URI for the REST application—analogous to a human Web user accessing the [[home page]] of a website—a REST client should then be able to use server-provided links dynamically to discover all the available resources it needs. As access proceeds, the server responds with text that includes [[hyperlink]]s to other resources that are currently available. There is no need for the client to be hard-coded with information regarding the structure of the server.<ref name="RESTfulAPI.net">{{cite web |last=Gupta |first=Lokesh |date=2 June 2018 |title=REST HATEOAS |url=http://restfulapi.net/hateoas/ |url-status=live |access-date=March 10, 2019 |website=REST API Tutorial |publisher=RESTfulAPI.net |language=en-US |archive-date=7 April 2019 |archive-url=https://web.archive.org/web/20190407073345/https://restfulapi.net/hateoas/ }}</ref> == Classification models == Several models have been developed to help classify REST APIs according to their adherence to various principles of REST design, such as * the [[Richardson Maturity Model]] * the Classification of HTTP-based APIs<ref>{{Cite web |title=Classification of HTTP APIs |url=http://algermissen.io/classification_of_http_apis.html |url-status=live |access-date=2023-01-29 |website=algermissen.io |language=en-US |archive-date=2023-01-29 |archive-url=https://web.archive.org/web/20230129022641/http://algermissen.io/classification_of_http_apis.html }}</ref> * the W S<sup>3</sup> maturity model<ref>{{Cite journal |last=Ivan Salvadori, Frank Siqueira |date=June 2015 |title=A Maturity Model for Semantic RESTful Web APIs |url=https://www.researchgate.net/publication/281287283 |journal=Conference: Web Services (ICWS), 2015 IEEE International Conference OnAt |location=New York |language=en-US |via=ResearchGate |access-date=2020-12-14 |archive-date=2024-02-27 |archive-url=https://web.archive.org/web/20240227165042/https://www.researchgate.net/publication/281287283_A_Maturity_Model_for_Semantic_RESTful_Web_APIs |url-status=live }}</ref> == See also == * {{Annotated link|Clean URL}} * {{Annotated link|Content delivery network}} * {{Annotated link|Domain application protocol}} (DAP) * {{Annotated link|List of URI schemes}} * {{Annotated link|Microservices}} * {{Annotated link|Overview of RESTful API Description Languages}} * {{Annotated link|Resource-oriented architecture}} * {{Annotated link|Resource-oriented computing}} * {{Annotated link|Service-oriented architecture}} * {{Annotated link|Web-oriented architecture}} * {{Annotated link|Web service}} == References == {{Reflist}} == Further reading == * {{Citation|last1=Pautasso|first1=Cesare|last2=Wilde|first2=Erik|last3= Alarcon |first3=Rosa|date=2014|title=REST: Advanced Research Topics and Practical Applications|url=https://www.springer.com/engineering/signals/book/978-1-4614-9298-6|isbn=9781461492986|publisher=Springer}} * {{Citation|last1=Pautasso|first1=Cesare|last2=Zimmermann|first2=Olaf|last3=Leymann|first3=Frank|date=April 2008|title= Proceedings of the 17th international conference on World Wide Web|chapter=Restful web services vs. "big"' web services |pages=805–814 |url=http://www.jopera.org/docs/publications/2008/restws |doi=10.1145/1367497.1367606 |isbn=9781605580852 |s2cid=207167438 |url-access=subscription}} * {{Citation|last1=Ferreira|first1=Otavio|date=Nov 2009|title=Semantic Web Services: A RESTful Approach|url=https://otaviofff.github.io/restful-grounding/|publisher=IADIS|isbn=978-972-8924-93-5}} * {{Cite web| last = Fowler| first = Martin| title = Richardson Maturity Model: steps towards the glory of REST| website = martinfowler.com| access-date = 2017-06-26| date = 2010-03-18| url = https://martinfowler.com/articles/richardsonMaturityModel.html}} {{Web interfaces}} {{Authority control}} [[Category:Cloud standards]] [[Category:Hypertext Transfer Protocol]] [[Category:Software architecture]] [[Category:Web 2.0 neologisms]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Annotated link
(
edit
)
Template:Authority control
(
edit
)
Template:Citation
(
edit
)
Template:Cite book
(
edit
)
Template:Cite journal
(
edit
)
Template:Cite thesis
(
edit
)
Template:Cite web
(
edit
)
Template:Other uses
(
edit
)
Template:Pp-pc
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Web interfaces
(
edit
)