cURL Örnekleri
cURL ile API istekleri yapmak için örnekler.
Temel Kullanım
GET İsteği
curl -X GET https://api.example.com/api/v1/users \
-H "Authorization: Bearer YOUR_TOKEN"
POST İsteği
curl -X POST https://api.example.com/api/v1/users \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "John Doe",
"email": "john@example.com"
}'
PUT İsteği
curl -X PUT https://api.example.com/api/v1/users/{uuid} \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Jane Doe"
}'
DELETE İsteği
curl -X DELETE https://api.example.com/api/v1/users/{uuid} \
-H "Authorization: Bearer YOUR_TOKEN"
Login Örneği
curl -X POST https://api.example.com/api/v1/login \
-H "Content-Type: application/json" \
-d '{
"email": "admin@example.com",
"password": "secret123",
"device_name": "MyDevice"
}'
Query Parametreleri
curl -X GET "https://api.example.com/api/v1/users?search=john&is_active=true&page=1&per_page=20" \
-H "Authorization: Bearer YOUR_TOKEN"
Hata Ayıklama
Verbose mod ile detaylı bilgi:
curl -v -X GET https://api.example.com/api/v1/users \
-H "Authorization: Bearer YOUR_TOKEN"
İlgili Dokümantasyon
- API Genel Bakış - API temel bilgileri
- Kimlik Doğrulama - Login endpoint'i