name: http-client description: 发送HTTP请求,支持所有方法、请求头、认证和响应处理。 metadata: short-description: HTTP请求客户端 source: repository: https://github.com/psf/requests license: Apache-2.0
HTTP客户端工具
描述
发送HTTP请求,全面支持GET、POST、PUT、DELETE方法,以及请求头、身份验证和文件上传功能。
触发条件
/http命令- 用户需要进行API调用时
- 用户想要测试API端点时
使用方法
# GET请求
python scripts/http_client.py GET https://api.example.com/users
# 带JSON请求体的POST请求
python scripts/http_client.py POST https://api.example.com/users --json '{"name": "John"}'
# 带请求头的请求
python scripts/http_client.py GET https://api.example.com/data --header "Authorization: Bearer token"
# 上传文件
python scripts/http_client.py POST https://api.example.com/upload --file document.pdf
标签
http, api, rest, requests, client
兼容性
- Codex: ✅
- Claude Code: ✅