Test and monitor REST and GraphQL APIs with validation.
bash
python3 scripts/api_test.py \
--method GET \
--url "https://api.example.com/users" \
--expect-status 200
bash
python3 scripts/api_test.py \
--method POST \
--url "https://api.example.com/users" \
--header "Content-Type: application/json" \
--body '{"name": "Alice"}' \
--expect-status 201
bash
python3 scripts/api_test.py \
--method GET \
--url "https://api.example.com/users/1" \
--validate '{
"type": "object",
"required": ["id", "name"],
"properties": {
"id": {"type": "integer"},
"name": {"type": "string"}
}
}'
bash
python3 scripts/api_test.py \
--graphql \
--url "https://api.example.com/graphql" \
--query '{ users { id name } }'
bash
python3 scripts/api_test.py \
--suite ./tests/api_tests.yaml
bash
python3 scripts/api_test.py \
--monitor \
--url "https://api.example.com/health" \
--interval 60
json
{
"success": true,
"status_code": 200,
"response_time_ms": 145,
"response": {"id": 1, "name": "Alice"},
"validation_passed": true
}