11. Output
TU Tran
- Use header request
Accept: application/json
- Use query string
Get http://localhost/user.json
- Use file extension
Get http://localhost/user.json
12. Constraints
TU Tran
Client – Server
Uniform Interface
Stateless
Cacheable
Layered System
Code on Demand (optional)
13. Constraints / Client - Server
TU Tran
I will show this as
the list of users
OK, I will get this
from MSSQL
14. - Get detail of #4 user:
../api/users/4
- Get detail of #2 category:
../api/categories/2
Constraints / Uniform Interface
TU Tran
15. The request must be independent each other
Easy to add more servers if need
Constraints / Stateless
TU Tran
Web server
Client (Browser)
Request
Response
Hey Server, Please
looks in the package
to get whatever you
need
OK, I have all
information to
process your request
Was used as the interface between client and server
Saperated concern: client care how to display data, server cares how to save data
Specify what client expect to receive format of data
Some client can handle well on json, some other can handle well on xml
Common ways
Any commit will trigger process to check and report the result
Should make it automate
Should make it automate
Set the same target to end user
- High-quality software, Faster releases, and Improved customer satisfaction who usually expects fast and stable features
Improved deploy frequency which can lead to faster time to market
Lower failure rate
Shortened lead time
Faster mean time to recovery