Upload
others
View
9
Download
0
Embed Size (px)
Citation preview
REST APIAssit.Prof. Dr. Anantakul Intarapadung
What is an API?
API in java
Rest API
Demo
Demo
Demo
Architecture
Server = maps.googleApis.com
Resource = /maps
/api
/geocode
/json
Google Maps APIs Web Services
What is JSON?
JSON (Java Script Object Notation)
เป็นวธิกีารทีท่ าให ้ JavaScript แลกเปลีย่นขอ้มลูกบั Server ไดง้า่ยขึน้ รปูแบบของ JSONนัน้ จะคลายๆกบัโครงสรา้งอารเ์รย์ รปูแบบเป็นประโยคก็คอื JSONถกูสรา้งขึน้จากชดุขอ้มลูของ literal object notationใน JavaScript JSON จะใช ้ [] แทน array และใช ้ {} แทน hash (หรอืassociate array ) แตล่ะสมาชกิคัน่ดว้ย comma (,) และแตล่ะ ชือ่สมาชกิคัน่ดว้ย colon (:)
Example Web Service API in Netbeans
Google Maps in Java Swing Application
Referrences
[1] https://www.youtube.com/watch?v=7YcW25PHnAA
[2] https://www.youtube.com/watch?v=oBW_VNg4qD0&t=407s
[3] https://developers.google.com/maps/web-services/overview