← 返回 Skills 市场
ericlooi504

REST API Tester

作者 ericlooi504 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
12
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install rest-api-test-cli
功能描述
REST API testing and validation toolkit. Send requests, validate responses, benchmark performance, generate HTML reports. Use when the user wants to: (1) Tes...
使用说明 (SKILL.md)

API Tester

Test, validate, and benchmark REST APIs with a single command. No external dependencies — uses only Python standard library.

Quick start

# Test a single endpoint
python3 skills/api-tester/scripts/api_tester.py --url https://api.github.com/repos/openclaw/openclaw

# POST with JSON body
python3 skills/api-tester/scripts/api_tester.py \
  --url https://jsonplaceholder.typicode.com/posts \
  --method POST \
  --body '{"title":"test","body":"hello","userId":1}'

# Test with custom headers
python3 skills/api-tester/scripts/api_tester.py \
  --url https://api.example.com/secure \
  --headers '{"Authorization":"Bearer token123"}'

Common commands

Command Action
--url URL Target API endpoint (required)
--method GET|POST|PUT|DELETE|PATCH HTTP method
--headers '{"K":"V"}' Custom headers as JSON
--body '{"key":"value"}' Request JSON body
--body-file path.json Read body from file
--verbose Show response body
--validate Validate status code + response time
--expected-status 201 Expected HTTP status (default: 200)
--validate-keys id name email Expected JSON keys in response
--benchmark Run multiple iterations
--iterations 10 Benchmark iterations (default: 5)
--max-time 5000 Max acceptable time in ms (default: 3000)
--timeout 60 Request timeout (default: 30)
--report Generate HTML test report
--output report.html Save report to path
--spec openapi.json --test-all Test all endpoints from spec

Validation

Validate API responses automatically:

python3 skills/api-tester/scripts/api_tester.py \
  --url https://jsonplaceholder.typicode.com/posts/1 \
  --validate --validate-keys userId id title body

Output:

Validation: ✅ PASS
  3/3 checks passed
  ✅ status_code: expected=200, actual=200
  ✅ response_time: expected=\x3C3000ms, actual=234ms
  ✅ key_exists: userId: expected=present, actual=found

Benchmarking

Test endpoint performance over multiple iterations:

python3 skills/api-tester/scripts/api_tester.py \
  --url https://jsonplaceholder.typicode.com/posts \
  --benchmark --iterations 10

Output:

Benchmark: GET https://jsonplaceholder.typicode.com/posts
  Iterations: 10
  Min:    142ms
  Max:    312ms
  Avg:    198ms
  Median: 189ms
  Success: 10/10

HTML Reports

Generate a styled HTML report for sharing:

python3 skills/api-tester/scripts/api_tester.py \
  --url https://jsonplaceholder.typicode.com/posts/1 \
  --verbose --report
# Creates: api-test-report-20260510-133000.html

Testing from OpenAPI Spec

Test all endpoints defined in an OpenAPI/Swagger specification:

python3 skills/api-tester/scripts/api_tester.py \
  --spec openapi.json \
  --test-all

Requirements

  • Python 3.6+ (no pip install needed)
  • Uses only urllib from standard library
  • Works on Linux, macOS, Windows
  • No external API calls
安全使用建议
Before installing or using this skill, confirm the API host, method, token, and environment. Prefer staging endpoints and least-privilege tokens, be careful with DELETE/PATCH/POST and `--test-all`, and review generated HTML reports for sensitive data before sharing.
功能分析
Type: OpenClaw Skill Name: rest-api-test-cli Version: 1.0.0 The skill is a standard REST API testing utility that uses the Python standard library (urllib) to perform HTTP requests, benchmarks, and validation. The code in scripts/api_tester.py is well-structured, implements proper SSL verification, and lacks any indicators of data exfiltration, persistence, or malicious execution. The documentation in SKILL.md is aligned with the script's functionality and does not contain prompt injection attempts or instructions to perform unauthorized actions.
能力评估
Purpose & Capability
The stated purpose and visible code align: it sends HTTP requests, validates responses, benchmarks endpoints, and generates reports. The noteworthy capability is that it supports mutating methods and spec-wide or repeated testing.
Instruction Scope
The commands appear user-directed and no hidden auto-execution is shown, but the documentation does not explicitly require confirmation before POST/PUT/PATCH/DELETE, benchmark runs, or testing all endpoints from a spec.
Install Mechanism
No installer, package download, or external dependency is shown; the skill uses an included Python script and documents a Python 3.6+ requirement.
Credentials
Outbound requests to user-specified URLs, optional body-file input, and report file output are proportionate for an API tester, but they can affect live services if used with the wrong target or token.
Persistence & Privilege
No background persistence, privileged setup, or required credential store access is shown. Optional Authorization headers and generated reports may still contain sensitive API data.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install rest-api-test-cli
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /rest-api-test-cli 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: REST API testing, validation, benchmarking, HTML reports
元数据
Slug rest-api-test-cli
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

REST API Tester 是什么?

REST API testing and validation toolkit. Send requests, validate responses, benchmark performance, generate HTML reports. Use when the user wants to: (1) Tes... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 12 次。

如何安装 REST API Tester?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install rest-api-test-cli」即可一键安装,无需额外配置。

REST API Tester 是免费的吗?

是的,REST API Tester 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

REST API Tester 支持哪些平台?

REST API Tester 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 REST API Tester?

由 ericlooi504(@ericlooi504)开发并维护,当前版本 v1.0.0。

💬 留言讨论