Lección 7 de 8
Probar APIs
Antes de usar una API en tu app, pruébala. cURL es una herramienta de terminal para peticiones HTTP. Postman es una app con interfaz gráfica para probar APIs. Ambas te ayudan a entender qué devuelve la API.
APIS
# Probar con cURL
curl https://api.example.com/users
# POST con cURL
curl -X POST https://api.example.com/users \
-H "Content-Type: application/json" \
-d '{"name":"Ali"}'
# En Postman:
# 1. Enter the URL
# 2. Choose the HTTP method
# 3. Add headers if needed
# 4. Click Send and see the response