| name | httpie-api-tester |
| description | Discover, document, and test all API endpoints in the current project using HTTPie (the modern CLI HTTP client). Use this skill whenever the user wants to: test their API endpoints, run HTTP requests against a local or remote server, check if routes are working, debug API responses, or generate a test suite for their backend. Trigger on any mention of "test my API", "test endpoints", "check my routes", "run HTTPie", "http requests", "API testing", or when the user asks to verify a server is working. Also trigger proactively when the user has just set up a backend and might want to validate it.
|
HTTPie API Tester
Use this skill to automatically discover all API endpoints in a project and test them with HTTPie.
Overview
HTTPie (http) is a modern, human-friendly CLI HTTP client. It produces colorized, formatted output and has terse syntax for common patterns.
Install if missing:
pip install httpie --break-system-packages
Step 1: Discover Endpoints
Scan the project to find all defined API routes. Use multiple strategies in parallel:
Framework Detection & Route Discovery
find . -name "package.json" -o -name "requirements.txt" -o -name "Gemfile" \
-o -name "go.mod" -o -name "Cargo.toml" | head -5
Then use the appropriate strategy from references/discovery.md for the detected framework.
Quick universal scan (works across frameworks):
grep -rn --include="*.js" --include="*.ts" --include="*.py" --include="*.rb" \
--include="*.go" --include="*.java" --include="*.rs" \
-E "(GET|POST|PUT|PATCH|DELETE|app\.(get|post|put|patch|delete)|router\.(get|post|put|patch|delete)|@(Get|Post|Put|Patch|Delete|RequestMapping))" \
. --exclude-dir={node_modules,.git,dist,build,vendor} 2>/dev/null | head -60
Also check for OpenAPI/Swagger specs:
find . -name "openapi.yml" -o -name "openapi.yaml" -o -name "swagger.json" \
-o -name "swagger.yaml" -o -name "api.yml" 2>/dev/null | head -5
Read references/discovery.md for framework-specific patterns (Express, FastAPI, Django, Rails, Go, etc.)
Step 2: Determine Base URL
Ask the user or infer from config files:
cat .env 2>/dev/null || cat .env.local 2>/dev/null || cat config/application.rb 2>/dev/null
grep -r "PORT\|HOST\|BASE_URL\|SERVER_URL" .env* config* *.config.* 2>/dev/null | head -10
HTTPie localhost shorthand:
:3000 → http://localhost:3000
:/api/users → http://localhost/api/users
Default assumption: http://localhost:8000 (adjust per project).
Step 3: Build & Run HTTPie Commands
HTTPie Syntax Reference
http GET :8000/api/users
http POST :8000/api/users name="Alice" email="alice@example.com"
http PUT :8000/api/users/1 name="Alice Updated"
http PATCH :8000/api/users/1 active:=false
http DELETE :8000/api/users/1
http GET :8000/api/protected Authorization:"Bearer <token>"
http GET :8000/api/search q==hello page==1
http --json POST :8000/api/data key=value count:=42 tags:='["a","b"]'
http --form POST :8000/upload file@/path/to/file.txt
http -a username:password GET :8000/api/secure
http --bearer TOKEN GET :8000/api/secure
http --check-status ...
http --timeout=5 ...
http --verify=no ...
http --follow ...
http --print=HhBb ...
http --ignore-stdin --check-status GET :8000/health
Testing Patterns
Health check first:
http --ignore-stdin GET :8000/health || http --ignore-stdin GET :8000/
Test with output saved:
http GET :8000/api/users > /tmp/users_response.json
Test all endpoints in sequence, report pass/fail:
http --check-status --ignore-stdin GET :8000/api/users && echo "✅ GET /api/users" || echo "❌ GET /api/users"
Step 4: Run the Test Suite Script
Use scripts/run_tests.sh as a template — generate a customized version for the project.
See references/test_script_template.sh for the full template with:
- Color-coded pass/fail output
- Response time tracking
- Summary report at the end
- Auth token support
Step 5: Report Results
Present results in a clear table:
| Method | Endpoint | Status | Time | Result |
|---|
| GET | /api/users | 200 | 45ms | ✅ Pass |
| POST | /api/users | 201 | 63ms | ✅ Pass |
| DELETE | /api/users/999 | 404 | 12ms | ✅ Pass (expected) |
Note any:
- Unexpected status codes
- Slow responses (>500ms)
- Auth-required endpoints that need tokens
- Endpoints that need request body examples
Tips & Edge Cases
- Server not running: Remind user to start their dev server first
- Auth endpoints: Ask for a token or credentials; test
/login or /auth first and extract the token
- Dynamic IDs: Use a real ID from a prior GET response or ask the user
- CORS/SSL issues in dev: Use
--verify=no for self-signed certs
- Streaming responses: Use
http --stream GET :8000/events
- File uploads: Use
http --multipart POST :8000/upload file@./test.png