Thuta Learning
ရှာဖွေရန်
IntermediateWeb Developmentintermediate

Request ဥပမာများ (curl & JS)

စိတ်လျှော့ပါ။ ဒီခန်းကို စာအုပ်လိုမဟုတ်ဘဲ စကားပြောသလိုပဲ၊ နားလည်လွယ်အောင် ရှင်းပါမယ်။

Request ဥပမာများ

curl

text
curl -X POST "https://api.example.com/v1/users"   -H "Content-Type: application/json"   -d '{"name":"Alice","email":"alice@example.com"}'

JavaScript (fetch)

text
const res = await fetch('https://api.example.com/v1/users', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ name: 'Alice', email: 'alice@example.com' })
});
const data = await res.json();

🎯 Result{ "id": "u_1", "name": "Alice", "email": "alice@example.com", "createdAt": "2025-10-05T10:00:00Z" }