API funktioniert nicht? Hier ist ein komplettes Toolkit zum Debugging von 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 für komplexes Testen. Collections, Environments, Pre-Request Scripts.
4. mitmproxy¶
mitmproxy # interaktiver Proxy auf :8080
5. ngrok¶
ngrok http 3000
6. jq für Responses¶
curl -s api.example.com/users | jq ‘.[] | {id, name}’
7. Watch¶
watch -n 5 “curl -s api.example.com/health | jq .”
8. Lasttests¶
hey -n 1000 -c 50 https://api.example.com/users
HTTP-Statuscodes¶
- 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 → Statuscode prüfen → jq für Response → mitmproxy für tiefere Analyse.