home / skills / aidotnet / moyucode / http-client

http-client skill

/skills/tools/http-client

This skill enables you to make HTTP requests across methods with headers, authentication, and response handling to test and interact with APIs.

npx playbooks add skill aidotnet/moyucode --skill http-client

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
1016 B
---
name: http-client
description: 发送HTTP请求,支持所有方法、请求头、认证和响应处理。
metadata:
  short-description: HTTP请求客户端
source:
  repository: https://github.com/psf/requests
  license: Apache-2.0
---

# HTTP Client Tool

## Description
Make HTTP requests with full support for GET, POST, PUT, DELETE, headers, authentication, and file uploads.

## Trigger
- `/http` command
- User needs to make API calls
- User wants to test endpoints

## Usage

```bash
# GET request
python scripts/http_client.py GET https://api.example.com/users

# POST with JSON body
python scripts/http_client.py POST https://api.example.com/users --json '{"name": "John"}'

# With headers
python scripts/http_client.py GET https://api.example.com/data --header "Authorization: Bearer token"

# Upload file
python scripts/http_client.py POST https://api.example.com/upload --file document.pdf
```

## Tags
`http`, `api`, `rest`, `requests`, `client`

## Compatibility
- Codex: ✅
- Claude Code: ✅

Overview

This skill is an HTTP client that sends requests with full support for GET, POST, PUT, DELETE and other methods. It accepts custom headers, authentication, JSON bodies, form data and file uploads, then returns status, headers and response body for inspection. It is implemented in TypeScript and designed for scripting and interactive API testing.

How this skill works

You provide method, URL and optional parameters (headers, auth, JSON, form fields, files). The client constructs the HTTP request, attaches authentication and headers, encodes body (JSON or multipart), sends the request, and captures the response status, headers and body. It also exposes error details and HTTP-level diagnostics for debugging failed calls.

When to use it

  • Testing or debugging REST endpoints from scripts or command line
  • Automating API calls with custom headers and authentication
  • Uploading files to an API endpoint using multipart/form-data
  • Sending JSON payloads, form data, or raw bodies to a server
  • Inspecting response headers and status codes for integration checks

Best practices

  • Specify Content-Type and Authorization headers explicitly to avoid server rejections
  • Use JSON flag for structured payloads and multipart for file uploads
  • Log request and response headers when debugging authentication or CORS issues
  • Validate SSL/TLS settings or skip verification only in trusted environments
  • Handle non-2xx responses explicitly and surface response body for error insights

Example use cases

  • GET a resource list with custom Authorization header to verify token scopes
  • POST a JSON payload to create a user and examine the returned location header
  • PUT an updated record with ETag/If-Match headers to enforce optimistic concurrency
  • POST multipart/form-data including files and metadata to an upload endpoint
  • Run automated smoke tests that assert status codes and key response fields

FAQ

Which HTTP methods are supported?

All common methods are supported, including GET, POST, PUT, PATCH, DELETE, HEAD and OPTIONS.

How do I upload files?

Send files as multipart/form-data along with other form fields. The client will encode file parts and set appropriate boundaries.