返回顶部
a

api-testerAPI测试工具

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.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
5,317
下载量
免费
免费
3
收藏
概述
安装方式
版本历史

api-tester

API 测试器

一个轻量级、无依赖的OpenClaw HTTP客户端。

使用方法

基础GET请求

javascript
const api = require(skills/api-tester);
const result = await api.request(GET, https://api.example.com/data);
console.log(result.status, result.data);

带JSON体的POST请求

javascript
const api = require(skills/api-tester);
const payload = { key: value };
const headers = { Authorization: Bearer };
const result = await api.request(POST, https://api.example.com/submit, headers, payload);

返回格式

request函数返回一个Promise,解析为:

javascript
{
status: 200, // HTTP状态码
headers: { ... }, // 响应头
data: { ... }, // 解析后的JSON体(如适用)或原始字符串
raw: ..., // 原始响应体字符串
error: ... // 请求失败时的错误信息(网络错误、超时)
}

特性

  • - 零依赖:使用Node.js内置的http和https模块。
  • 自动JSON:自动序列化请求体,并在Content-Type匹配时解析响应体。
  • 超时支持:默认10秒超时,可配置。
  • 错误处理:返回结构化错误对象而非抛出异常,确保安全执行。

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 api-tester-1776419943 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 api-tester-1776419943 技能

通过命令行安装

skillhub install api-tester-1776419943

下载

⬇ 下载 api-tester v1.0.0(免费)

文件大小: 3.6 KB | 发布时间: 2026-4-17 19:50

v1.0.0 最新 2026-4-17 19:50
- Initial release of api-tester, a lightweight, dependency-free HTTP client for OpenClaw.
- Supports structured HTTP/HTTPS requests (GET, POST, PUT, DELETE) with custom headers and JSON body.
- Automatically stringifies JSON bodies and parses JSON responses.
- Includes timeout support (default 10s, configurable).
- Provides structured response with status, headers, parsed data, raw body, and error messaging.
- No external dependencies; uses Node.js built-in http/https modules.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部