درس 7 من 8
اختبار APIs
قبل استخدام API داخل تطبيقك، اختبرها. cURL أداة لسطر الأوامر لإرسال HTTP requests. Postman تطبيق بواجهة رسومية لاختبار APIs وفهم البيانات الراجعة.
APIS
# اختبار باستخدام cURL
curl https://api.example.com/users
# إرسال POST باستخدام cURL
curl -X POST https://api.example.com/users \
-H "Content-Type: application/json" \
-d '{"name":"Ali"}'
# داخل Postman:
# 1. Enter the URL
# 2. Choose the HTTP method
# 3. Add headers if needed
# 4. Click Send and see the response