Rest Flashcards
What is rest
REST?
Representational State Transfer
What is REST? (2)
- Architectural style for distributed systems
- Set of constraints
Critical term: Resource
any information (usually on web server), can be data or computing power
Critical term: Resource Identifier
the unique name of a resource
Critical term: URI
- Uniform Resource Identifier
- implementation of a resource identifier in HTTP protocol
- there are 2 forms
Critical term: URL
- Uniform Resource Locator
- web address
Critical term: URN
- Uniform Resource Name
Critical term: Representation
A representation is a sequence of bytes, which contains the serialized resource and information about the serialized resource (representation metadata)
! RESTful components exchange information and perform actions by transferring representations!
REST constraint 1
Client-server
REST constraint 2
Stateless
- the server wont cache any client or session related data
- client can cache data if needed
REST constraint 3
Cache
- client has ability to cache responses
- less cost for server and network traffic
REST constraint 4
Uniform Interface
- achieved by leveraging HTTP methods
- every resource has its own URL
REST constraint 5
Layered System
- improve scalability and reduce chaos in large system
- each layer can share a cache, sercurity and load balancing
REST constraint 6
Code on demand
- client functionality can be extended by downloading and executing code in form of applets or scripts
- optional constraint
Website
Web service provides its resources to web client
+ resources are static/dynamic web pages