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.
A lightweight, dependency-free HTTP client for OpenClaw.
小蔥技能站7w4.net發現了升級外掛。
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等請求,錯誤提示也比較友好。不足之處是功能相對基礎,缺少一些進階特性(比如請求重試、代理支援等),對於複雜的測試場景可能不夠用。日常簡單使用完全沒問題,但複雜需求需要找更專業的工具。