Appearance
03.04 HTTP Methods
📌 At a Glance
| รายการ | รายละเอียด |
|---|---|
| Topic | HTTP Methods |
| Difficulty | ⭐ Beginner |
| Reading Time | 5 นาที |
| Target | Developer |
🎯 Learning Objectives
หลังจากศึกษาหัวข้อนี้แล้ว ผู้อ่านจะสามารถ
- เข้าใจ HTTP Methods ที่ SISAHYGO API ใช้งาน
- เลือกใช้ Method ได้ถูกต้อง
- เข้าใจข้อจำกัดของแต่ละ Method
Overview
SISAHYGO API V1.1 ใช้มาตรฐาน HTTP Methods ตามแนวทาง REST API
ในเวอร์ชันปัจจุบัน มีการใช้งานเพียง GET และ POST ซึ่งครอบคลุมกระบวนการเชื่อมต่อทั้งหมดระหว่าง Client System และ SISAHYGO
Figure 3-4 HTTP Methods
(แทรกรูป Figure 3-4 : HTTP Methods Matrix)

Figure 3-4 แสดงการแบ่งประเภทของ HTTP Methods ที่รองรับใน SISAHYGO API พร้อมตัวอย่าง Endpoint และวัตถุประสงค์การใช้งาน
Supported Methods
| Method | Purpose | Example |
|---|---|---|
| GET | อ่านข้อมูล | /products |
| POST | สร้างข้อมูล | /order-checkings |
Endpoint Mapping
| Endpoint | Method | Description |
|---|---|---|
/products | GET | ดึงข้อมูลรายการสินค้า |
/receivers | GET | ดึงข้อมูลผู้รับ |
/shipments | GET | ติดตามสถานะการขนส่ง |
/order-rejections | GET | ตรวจสอบรายการที่ถูก Reject |
/order-checkings | POST | สร้างรายการตรวจรับสินค้า |
Methods Not Supported
HTTP Methods ต่อไปนี้ยังไม่เปิดให้บริการใน API V1.1
| Method | Status |
|---|---|
| PUT | Not Supported |
| PATCH | Not Supported |
| DELETE | Not Supported |
หากมีการเปิดให้บริการในอนาคต จะประกาศใน Release Notes ของ API Version ใหม่
Key Points
| Method | Safe | Idempotent |
|---|---|---|
| GET | ✅ | ✅ |
| POST | ❌ | ❌ |
Implementation Notes
- ใช้ GET สำหรับอ่านข้อมูลเท่านั้น
- ใช้ POST สำหรับสร้าง Transaction ใหม่
- ไม่ควรใช้ GET เพื่อส่งข้อมูลที่มีผลต่อ Business Logic
- ทุก Request ต้องส่งผ่าน HTTPS
Best Practices
- ใช้ HTTP Method ให้ตรงกับวัตถุประสงค์
- ตรวจสอบ HTTP Status Code ทุกครั้ง
- ไม่ใช้ Query String สำหรับข้อมูลจำนวนมาก
- กำหนด
Content-Type: application/jsonสำหรับทุก POST Request
Summary
SISAHYGO API V1.1 รองรับ HTTP Methods เพียง 2 ประเภท ได้แก่ GET และ POST ซึ่งเพียงพอสำหรับการเชื่อมต่อกับ Client System และช่วยให้ API มีความเรียบง่าย เรียนรู้ได้ง่าย และดูแลรักษาได้สะดวก
Next Step
➡️ 03.05 Request Format
