API not working? Here is a complete toolkit for debugging REST APIs.
1. curl¶
curl -v https://api.example.com/users curl -X POST -H “Content-Type: application/json” -d ‘{“name”:”John”}’ api.example.com/users curl -o /dev/null -s -w “TTFB: %{time_starttransfer}s\nTotal: %{time_total}s\n” URL
2. HTTPie¶
http GET api.example.com/users http POST api.example.com/users name=John
3. Postman / Insomnia¶
GUI for complex testing. Collections, environments, pre-request scripts.
4. mitmproxy¶
mitmproxy # interactive proxy on :8080
5. ngrok¶
ngrok http 3000
6. jq for responses¶
curl -s api.example.com/users | jq ‘.[] | {id, name}’
7. Watch¶
watch -n 5 “curl -s api.example.com/health | jq .”
8. Load testing¶
hey -n 1000 -c 50 https://api.example.com/users
HTTP Status Codes¶
- 200 OK
- 201 Created
- 400 Bad Request
- 401 Unauthorized
- 403 Forbidden
- 404 Not Found
- 429 Rate Limit
- 500 Server Error
- 502 Bad Gateway
- 503 Unavailable
Workflow¶
curl -v → check status code → jq for response → mitmproxy for deeper analysis.