返回顶部
a

api-tester

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,240
下载量
3
收藏
概述
安装方式
版本历史

api-tester

# API Tester A lightweight, dependency-free HTTP client for OpenClaw. ## Usage ### Basic GET Request ```javascript const api = require('skills/api-tester'); const result = await api.request('GET', 'https://api.example.com/data'); console.log(result.status, result.data); ``` ### POST Request with JSON Body ```javascript 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); ``` ### Return Format The `request` function returns a Promise resolving to: ```javascript { 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) } ``` ## Features - **Zero dependencies**: Uses Node.js built-in `http` and `https` modules. - **Auto-JSON**: Automatically stringifies request body and parses response body if Content-Type matches. - **Timeout support**: Default 10s timeout, configurable. - **Error handling**: Returns structured error object instead of throwing, ensuring safe execution.

标签

skill ai

通过对话安装

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

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

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

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

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

通过命令行安装

skillhub install api-tester-1776419943

下载 Zip 包

⬇ 下载 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
返回顶部