← 返回 Skills 市场
gopendrasharma89-tech

Clean HTTP Toolkit

作者 gopendrasharma89-tech · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ✓ 安全检测通过
28
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install clean-http-toolkit
功能描述
Local HTTP client + tiny server toolkit for AI agents. GET / POST / PUT / PATCH / DELETE with retries on 5xx/429, gzip decoding, redirect following, --bearer...
使用说明 (SKILL.md)

clean-http-toolkit

v0.1.0

Fifth member of the clean-* family. AI agents constantly need to fetch a URL, POST to an API, download a dataset, or run a mock server for tests — and currently the only option is shell-out to curl (no retry logic) or pip-install requests. This toolkit gives them all four in pure stdlib.

Scripts

  • scripts/get.py — HTTP GET with retries (5xx/429), gzip decoding, redirect-following, --bearer TOKEN, --basic USER:PASS, --header 'Name: V', --query K=V, --json pretty-print, --print-headers, --status-only, --fail (exit 1 on non-2xx).
  • scripts/post.py — POST / PUT / PATCH / DELETE via --method. Body sources: --json '\x3CJSON>', --json-file PATH, --form K=V (repeatable), --raw-file PATH (with --content-type). Same auth + retry options as get.py.
  • scripts/download.py — streaming file download with progress bar on stderr, retries on transient errors, --resume for incomplete files, --sha256 HEX / --md5 HEX verification, configurable --chunk-size. Memory stays bounded regardless of file size.
  • scripts/serve.py — tiny local HTTP server for tests. Two modes: static (serve a directory, like python3 -m http.server but with --max-requests N cutoff so CI tests can run and exit cleanly) and echo (reply to every request with a JSON envelope describing the request itself — perfect for webhook smoke tests). Binds to 127.0.0.1 by default for safety.
  • scripts/check_deps.sh — verify python3.

Quick start

# Simple GET
python3 scripts/get.py https://api.example.com/users

# GET with auth, query params, JSON pretty-print
python3 scripts/get.py https://api.example.com/users \
    --bearer "$TOKEN" \
    --query 'limit=20' --query 'page=1' \
    --json

# Just the status code (great for health checks)
python3 scripts/get.py https://example.com --status-only

# POST JSON
python3 scripts/post.py https://api.example.com/users \
    --json '{"name":"Alice","email":"[email protected]"}' \
    --bearer "$TOKEN"

# POST a form
python3 scripts/post.py https://example.com/login \
    --form 'user=alice' --form 'pass=secret'

# PUT a JSON file
python3 scripts/post.py https://api.example.com/items/42 \
    --method PUT --json-file payload.json

# Download with progress + SHA-256 verification
python3 scripts/download.py \
    https://releases.example.com/model.tar.gz \
    ~/Downloads/model.tar.gz \
    --sha256 abc123def456...

# Resume an incomplete download
python3 scripts/download.py URL out.bin --resume

# Local static server for tests
python3 scripts/serve.py --directory ./public --port 8080

# Echo server for webhook smoke tests (auto-exits after 5 requests)
python3 scripts/serve.py --mode echo --port 9000 --max-requests 5

Exit codes

Code Meaning
0 success / 2xx response (or any response if --fail not set)
1 --fail and response was non-2xx; or --sha256 / --md5 mismatch on download
2 bad arguments / unsafe path / bad URL / network error / non-2xx download

Safety properties

  • Pure Python 3 standard library (urllib, http.server). No requests, no httpx, no pip install.
  • All file paths validated against the same safe-path policy as the other clean-* toolkits.
  • All URLs validated: must be http:// or https:// with a host.
  • serve.py binds to 127.0.0.1 by default; you must pass --bind 0.0.0.0 explicitly to expose it.
  • --insecure is opt-in only — TLS verification is on by default.
  • Retries are bounded (--retries N, default 3) with exponential backoff capped at the backoff base × 2^attempt.

Why pure stdlib

Agents are usually run in restricted environments (sandboxes, CI runners, ephemeral containers) where pip install either fails, is forbidden, or burns minutes of setup time. Every script here uses only Python stdlib so it can run anywhere Python 3 is present.

Pairs well with

  • clean-text-toolkit — pipe get.py URL into htmlstrip.py to scrape a page to plain text in one command.
  • clean-json-toolkit — pipe API responses into query.py / validate.py / merge.py.
  • clean-log-toolkitserve.py static mode is useful for replaying captured log files over HTTP for parser tests.
  • clean-csv-toolkit — download a CSV with download.py, then inspect.py / validate.py it.

v0.1.0 changes

  • First public release. Four scripts: get.py, post.py, download.py, serve.py.
  • Shared _common.py with safe_path, safe_url, parse_headers, fetch (with retry + gzip + redirect handling).
  • All five clean-* toolkits now share the same safe-path policy, the same 0 / 1 / 2 exit-code contract, and the same zero-dependency principle.

License

MIT

安全使用建议
Before installing, be comfortable with a local HTTP toolkit that can send authenticated requests and write downloads. Avoid --insecure when using tokens or passwords, keep the test server bound to 127.0.0.1 unless you intentionally expose it, and do not send real API keys, cookies, or personal data to echo mode unless you are prepared for them to be reflected in the response.
能力标签
requires-oauth-tokenrequires-sensitive-credentials
能力评估
Purpose & Capability
The skill's GET, POST, download, and local test-server scripts match its stated purpose as a Python standard-library HTTP toolkit for agents.
Instruction Scope
The skill documents auth headers, echo mode, and the --insecure flag; these are user-directed, but echo mode has no secret redaction and --insecure can weaken HTTPS protections.
Install Mechanism
Install requirements are minimal and disclosed: Python 3 only, with no pip packages or automatic dependency installation.
Credentials
Network access, local file reads/writes for requested bodies/downloads, and a local HTTP server are proportionate to the toolkit's purpose; the server binds to 127.0.0.1 by default.
Persistence & Privilege
The skill does not add persistence or privilege escalation; the server can run until stopped if invoked without --max-requests, but this is explicit user-run behavior.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install clean-http-toolkit
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /clean-http-toolkit 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.0
v0.1.0 initial release. Fifth skill in the clean-* family (after csv, text, log, json). Pure stdlib HTTP client + tiny server for AI agents that need to fetch URLs, POST to APIs, download datasets, or run mock servers in tests - without pip install. Four scripts: get.py (HTTP GET with retries on 5xx/429, gzip, redirects, --bearer/--basic/--header/--query, --json pretty-print, --status-only, --fail), post.py (POST/PUT/PATCH/DELETE with --json/--json-file/--form/--raw-file body sources), download.py (streaming download with progress, --resume, --sha256/--md5 verification, configurable chunk-size), serve.py (local static-file server OR JSON echo server for webhook tests, --max-requests N for CI cleanup, binds 127.0.0.1 by default). Same safe-path policy and 0/1/2 exit-code contract as the other clean-* toolkits.
元数据
Slug clean-http-toolkit
版本 0.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Clean HTTP Toolkit 是什么?

Local HTTP client + tiny server toolkit for AI agents. GET / POST / PUT / PATCH / DELETE with retries on 5xx/429, gzip decoding, redirect following, --bearer... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 28 次。

如何安装 Clean HTTP Toolkit?

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

Clean HTTP Toolkit 是免费的吗?

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

Clean HTTP Toolkit 支持哪些平台?

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

谁开发了 Clean HTTP Toolkit?

由 gopendrasharma89-tech(@gopendrasharma89-tech)开发并维护,当前版本 v0.1.0。

💬 留言讨论