REST Flashcards
Get an understanding of what REST is.
1
Q
What is REST ?
A
- stands for Representational State Transfer
- was introduced and defined in 2000 by Roy Fielding
- rather than a standard, REST is an architectural style for designing distributed systems
- it is a set of constraints, such as: being stateless, having a client/server relationship, and a uniform interface
- REST is not strictly related to HTTP, but it is most commonly associated with it
2
Q
What is a RESTful web service?
A
- a web service that conforms to the REST architectural style
- provides interoperability between computer systems on the Internet
- allow the requesting systems to access and manipulate textual representations of web resources by using a uniform and predefined set of stateless operations
- when HTTP is used, as is most common, the operations available are GET, POST, PUT, DELETE, and other predefined CRUD HTTP methods
- requests to a resource’s URI will elicit a response that may be in XML, HTML, JSON, or some other format
- a response may confirm that some alteration has been made to the stored resource, and the response may provide hypertext links to other related resources or collections of resources
3
Q
Principles of REST
A
— Resources:
- expose an easily understood structure of URIs
— Representations:
- transfer JSON or XML to represent data objects and attributes
— Messages:
- use HTTP methods explicitly (for example, GET, POST, PUT, and DELETE)
— Stateless:
- interactions store no client context on the server between requests. State dependencies limit and restrict scalability
- The client holds session state
4
Q
Goals and Benefits of REST
A
Using a stateless protocol and standard HTTP operations, REST aims for:
- fast performance,
- reliability,
- ability to scale, by re-using components that can be managed and updated without affecting the system as a whole, even while it is running
5
Q
REST in a simplified nutshell
A
- HTTP commands pushing JSON packets over the network