REST API คืออะไร ?

Rest API คืออะไร ?
Rest ย่อมาจาก Representational State Transfer เป็น API(Application Programming Interface) เป็นรูปแบบการส่งข้อมูลระหว่าง Server-Client รูปแบบนึงที่อาศัย HTTP Method (GET, POST, PUT, Patch, DELETE, …) มี retrun type เป็น Json, XML, HTML, Text, .. ส่วนใหญ่นิยมใช้งานเป็น Json สามารถรับส่งข้อมูลไปมาข้าม Platform ผ่าน HTTP Protocol

HTTP Method
1. Get ใช้ร้องขอข้อมูล
2. Post ใช้สร้างข้อมูลใหม่
3. Put ใช้ update ข้อมูลที่มีอยู่แล้ว
4. Patch ใช้ update ข้อมูลที่มีอยู่แล้ว หรือถ้าไม่มีข้อมูลจะสร้างข้อมูลใหม่
5. Delete ใช้ลบข้อมูลที่มีอยู่แล้ว

HTTP response status codes
1. 1XX ข้อมูลทั่วไป
2. 2XX การร้องขอสำเร็จ
3. 3XX การเปลี่ยนเส้นทาง
4. 4XX ความผิดพลาดจากเครื่องลูกข่าย
5. 5XX ความผิดพลาดจากเครื่องแม่ข่าย

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response