Introduction
Communicate on web using services /
มี data บน web เรา และต้องการ share ให้คนอื่น
2.Using RESTful APIs and HATEOAS
REST overview /
Representation state transfer – guidelines ใช้ design APIs
ระหว่าง client -server
เข้าไปนั่งในร้านอาหาร – ขอดู menu – คือ API menu – สั่งอาหาร เป็น API call – kitchen cook food เป็น work of API -> เอาอาหาร มาส่งให้ เรา คือ API response back to client
4 API principles
1. data and fn in API เป็นresource – identified ผ่านที่เรียกว่า URI
Uniform resource indentifier เป็น web link
2. Manipulate , fixed set of operation
GET- retrieves-ดึงกลับ a resource
POST -creates a resource
PUT – Updates a resource
DELETE – removes a resource
3. Resources สามารถเป็นได้ทั้ง multiple formats eg
– Html , xml , plain text
– media type
4. Communicate client-endpoint – Stateless
คือ server ไม่ remember ไม่ store any state client made
eg ไปซื้อ กาแฟ มา 1 แก้ว
ไปอีกที บอก เอาเหมือนเดิม ไม่ได้แล้ว
ต้องสั่งใหม่
สรุป RESTful – simple ,lightwt , fast
