Android การใช้งาน Retrofit HTTP client สำหรับ Android และ Java
Posted onAndroid การใช้งาน Retrofit HTTP client สำหรับ Android และ Java Retrofit เป็น Library อีกตัวที่น่าสนใจสำหรับในการใช้เป็น HTTP Client ไว้ให้ app android ของเราสามารถดึงและใส่ข้อมูลผ่าน api ที่เป็น web service หรือ restful api ได้ โดยเจ้า Retrofit นั้นรองรับทั้ง xml และ json โดยในบทความนี้จะเป็นตัวอย่างการดึงข้อมูล json แบบ GET ซึ่งจะใช้ service ของ https://jsonplaceholder.typicode.com โดยจะมี 2 url คือ https://jsonplaceholder.typicode.com/posts จะทำการคืนค่าเป็น Array Json ที่เก็บข้อมูล Post ทั้งหมดที่มี https://jsonplaceholder.typicode.com/posts/id โดยจะคืนค่าเป็น Json Object […]