# 4.Verbs

💬 หลังจากที่เราสร้าง Web API ตัวแรกเสร็จไปละ เราก็ต้องมาเรียนรู้สิ่งที่เรียกว่า **verb** ที่ใช้ในเว็บ API กันเสียก่อนว่าปรกติทั่วโลกเขาเขียน API โดยใช้ verb แบบไหน และแต่ละ verb มีความหมายว่ายังไงกันบ้าง

{% embed url="<https://www.youtube.com/watch?v=hmC7CEHc-Cc&list=PLUjAn8nwWniheN3OLy6i7xu1VYq4Tzj7p&index=5>" %}

{% hint style="warning" %}
ถ้าเราไม่เข้าใจเรื่อง verb แล้วใช้ไปมั่วๆ จริงๆมันก็ทำงานได้เหมือนกันนะ แต่อย่าไปทำแบบนั้นเลยมันน่าอายมาก เพราะมันจะเป็นการ**ป่าวประกาศว่า developer ฝั่งที่เขียน API ไม่มีความเป็น professional เลย** และเพื่อนๆเชื่อไหมว่าบริษัทหลายๆแห่งที่ผมได้เข้าไปส่วนใหญ่จะเขียนเรื่องพวกนี้ผิด 😡
{% endhint %}

## 🎯 สรุปสั้นๆ

### 👨‍🚀 Verbs ต่างๆที่เรานิยมใช้กัน

Verbs พื้นฐานที่เรานิยมใช้มีตามตารางด้านล่างนี้

| Verb   | ความหมาย        |
| ------ | --------------- |
| GET    | ขอข้อมูล        |
| POST   | สร้างข้อมูลใหม่ |
| PUT    | อัพเดทข้อมูล    |
| DELETE | ลบข้อมูล        |

{% hint style="info" %}
**Verbs ในโลกของ Web API**\
จริงๆมันไม่ได้มีแค่ในตารางนี้นะครับ แต่ตัวหลักๆที่เราใช้กันบ่อยและควรจะต้องรู้คือ 4 ตัวที่ว่ามานี้
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.saladpuk.com/web/web-api-101/verbs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
