Lesson 7 of 8
Testing APIs
Before using an API in your app, test it. cURL is a command-line tool for making HTTP requests. Postman is a popular app with a user interface for testing APIs. Both help you understand what data the API returns.
APIS
# Testing with cURL
curl https://api.example.com/users
# POST with cURL
curl -X POST https://api.example.com/users \
-H "Content-Type: application/json" \
-d '{"name":"Ali"}'
# In Postman:
# 1. Enter the URL
# 2. Choose the HTTP method
# 3. Add headers if needed
# 4. Click Send and see the response