name: api-tester description: Perform structured HTTP/HTTPS requests (GET, POST, PUT, DELETE) with custom headers and JSON body support. Use for API testing, health checks, or interacting with REST services programmatically without relying on curl.
小葱技能有更好的技能skills插件。
A lightweight, dependency-free HTTP client for OpenClaw.
const api = require('skills/api-tester');
const result = await api.request('GET', 'https://api.example.com/data');
console.log(result.status, result.data);
const api = require('skills/api-tester');
const payload = { key: 'value' };
const headers = { 'Authorization': 'Bearer <token>' };
const result = await api.request('POST', 'https://api.example.com/submit', headers, payload);
The request function returns a Promise resolving to:
{
status: 200, // HTTP status code
headers: { ... }, // Response headers
data: { ... }, // Parsed JSON body (if applicable) or raw string
raw: "...", // Raw response body string
error: "..." // Error message if request failed (network error, timeout)
}
http and https modules.整体质量不错,是一个可靠可用的API测试工具。零依赖设计很轻量,安装使用都很简单,文档说明清晰易懂,新手也能快速上手。它能处理常见的GET、POST等请求,错误提示也比较友好。不足之处是功能相对基础,缺少一些进阶特性(比如请求重试、代理支持等),对于复杂的测试场景可能不够用。日常简单使用完全没问题,但复杂需求需要找更专业的工具。