diff options
author | Nguyễn Gia Phong <mcsinyx@disroot.org> | 2020-12-03 09:32:13 +0700 |
---|---|---|
committer | Nguyễn Gia Phong <mcsinyx@disroot.org> | 2020-12-03 09:32:13 +0700 |
commit | 8644699f4d2fce12a41289f9627bc45be9dd1965 (patch) | |
tree | d31190ac36d10e297eeab0f6e7a70dc24395695d /usth/ICT3.2/prac/5/1.md | |
parent | 82048ad9e3e4a96a38c8fa6a529798f40e33acb1 (diff) | |
download | cp-8644699f4d2fce12a41289f9627bc45be9dd1965.tar.gz |
[usth/ICT3.2] Develop web applications
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 |