diff options
Diffstat (limited to 'usth/ICT3.2/prac/5/1.md')
-rw-r--r-- | usth/ICT3.2/prac/5/1.md | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/usth/ICT3.2/prac/5/1.md b/usth/ICT3.2/prac/5/1.md new file mode 100644 index 0000000..6669da1 --- /dev/null +++ b/usth/ICT3.2/prac/5/1.md @@ -0,0 +1,43 @@ +# RESTful APIs +RESTful APIs, or REST (Representational State Transfer) +is a software architectural style allowing the requesting systems +to access and manipulate textual representation of Web resources +by using a uniform and predefined set of stateless operations. + +## Architectural Constraints +### Client-Server Architecture +Separating the UI concerns from the data storage concerns improves +* Portability of UI across multiple platforms +* Scalability (by simplifying the server components) + +### Statelessness +Session states are not stored on the server, +but maintained by and sent from the client. + +### Cacheability +Improve scalability and performance by caching appropriately. + +### Layered System +Improve performance (via caching) and security by intermediary servers. + +### Code on Demand (optional) +Transfer executable code. + +### Uniform Interface +* Resource identification in requests +* Resource manipulation through representation +* Self-descriptive messages +* Hypermedia as the engine of application state + +## The API +### URI +Base URI to collection resource, e.g. http://api.example.com/collection/ + +Member resource: http://api.example.com/collection/item42 + +### HTTP methods +* GET: retrieve resource representation +* POST: create member resource +* PUT: replace representation of resources +* PATCH: update resource representation +* DELETE: delete resource representation |