Token导航 LogoToken导航

Agent Skill · 前端设计

httpx(httpx 命令行)

httpx 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

httpx 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证为 MIT,第三方扫描有未通过项,按安装量在前端设计类的 10,216 个 Skill 里排第 4,518。

总安装 865周安装 35GitHub Stars 2下载 272核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:httpx(httpx 命令行)
来源仓库:https://github.com/slanycukr/riot-api-project
仓库路径:skills/httpx
安装命令:
npx skills add https://github.com/slanycukr/riot-api-project --skill httpx
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/slanycukr/riot-api-project --skill httpx

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

httpx 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态、代码变更或协作事项进行整理。

通过 npx skills add 命令从指定 GitHub 仓库安装,需结合原始 README 核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。当前无原始 SKILL.md 内容可参考,功能描述基于通用协作场景推断。

来源仓库内路径:skills/httpx

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/slanycukr/riot-api-project --skill httpx;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

httpx 怎么安装?

在终端执行 npx skills add https://github.com/slanycukr/riot-api-project --skill httpx。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

httpx 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

httpx 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

httpx 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

httpx 用的人多吗?

公开数据是累计安装 865 次,近一周安装 35 次,下载 272 次,GitHub 2 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

httpx 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
httpx

httpx 命令行 · 本页

8652接触敏感数据MIT未通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

HTTPX Skill

HTTPX is a fully featured HTTP client for Python that provides both synchronous and asynchronous APIs, with support for HTTP/1.1 and HTTP/2.

Quick Start

Basic Usage

import httpx

# Simple GET request
response = httpx.get('https://api.example.com/data')
print(response.status_code)
print(response.json())

# POST request with JSON data
response = httpx.post('https://api.example.com/users', json={'name': 'Alice'})

Async Usage

import asyncio
import httpx

async def fetch_data():
    async with httpx.AsyncClient() as client:
        response = await client.get('https://api.example.com/data')
        return response.json()

result = asyncio.run(fetch_data())

Common Patterns

1. Async Client with Connection Pooling

import httpx

async def make_multiple_requests():
    async with httpx.AsyncClient() as client:
        # Reuse the same client for multiple requests
        tasks = [
            client.get('https://api.example.com/users/1'),
            client.get('https://api.example.com/users/2'),
            client.get('https://api.example.com/users/3')
        ]
        responses = await asyncio.gather(*tasks)
        return [r.json() for r in responses]

2. Authentication

import httpx

# Basic Authentication
auth = httpx.BasicAuth(username='user', password='pass')
client = httpx.Client(auth=auth)

# Bearer Token Authentication
headers = {'Authorization': 'Bearer your-token-here'}
client = httpx.Client(headers=headers)

# Per-request authentication
response = client.get('https://api.example.com', auth=('user', 'pass'))

3. Streaming Downloads

import httpx

# Stream large files without loading into memory
with httpx.stream('GET', 'https://example.com/large-file.zip') as response:
    with open('large-file.zip', 'wb') as f:
        for chunk in response.iter_bytes():
            f.write(chunk)

# Async streaming
async def download_large_file():
    async with httpx.AsyncClient() as client:
        async with client.stream('GET', 'https://example.com/large-file.zip') as response:
            with open('large-file.zip', 'wb') as f:
                async for chunk in response.aiter_bytes():
                    f.write(chunk)

4. Streaming Uploads

import httpx

# Upload large files with streaming
async def upload_large_file():
    def generate_data():
        # Yield chunks of data
        for i in range(100):
            yield f'chunk {i}\n'.encode()

    async with httpx.AsyncClient() as client:
        response = await client.post(
            'https://api.example.com/upload',
            content=generate_data()
        )
        return response

5. Error Handling and Timeouts

import httpx

# Configure timeouts
client = httpx.Client(
    timeout=httpx.Timeout(10.0, connect=5.0, read=8.0)
)

try:
    response = client.get('https://api.example.com/slow')
    response.raise_for_status()  # Raise exception for 4XX/5XX responses
except httpx.TimeoutException:
    print("Request timed out")
except httpx.HTTPStatusError as e:
    print(f"HTTP error: {e.response.status_code}")
except httpx.RequestError as e:
    print(f"Request failed: {e}")

6. Client Configuration

import httpx

# Client with shared configuration
client = httpx.Client(
    base_url='https://api.example.com',
    headers={'User-Agent': 'MyApp/1.0'},
    timeout=30.0,
    follow_redirects=True
)

# All requests will use base_url and headers
response = client.get('/users')  # Makes request to https://api.example.com/users

7. Custom Authentication

import httpx

class CustomAuth(httpx.Auth):
    def __init__(self, api_key):
        self.api_key = api_key

    def auth_flow(self, request):
        request.headers['X-API-Key'] = self.api_key
        yield request

# Use custom auth
auth = CustomAuth('your-secret-api-key')
client = httpx.Client(auth=auth)

8. Progress Monitoring

import httpx
from tqdm import tqdm

def download_with_progress(url, filename):
    with httpx.stream('GET', url) as response:
        total = int(response.headers.get('content-length', 0))

        with tqdm(total=total, unit='B', unit_scale=True) as progress:
            with open(filename, 'wb') as f:
                for chunk in response.iter_bytes():
                    f.write(chunk)
                    progress.update(len(chunk))

9. Retry Logic

import httpx
import time

def make_request_with_retry(url, max_retries=3):
    for attempt in range(max_retries):
        try:
            response = httpx.get(url, timeout=10.0)
            response.raise_for_status()
            return response
        except httpx.RequestError as e:
            if attempt == max_retries - 1:
                raise
            time.sleep(2 ** attempt)  # Exponential backoff

10. WebSocket Support (with httpx-ws)

import httpx
from httpx_ws import connect_ws

async def websocket_example():
    async with httpx.AsyncClient() as client:
        async with connect_ws('wss://echo.websocket.org', client) as websocket:
            await websocket.send_text('Hello, WebSocket!')
            message = await websocket.receive_text()
            print(f"Received: {message}")

Practical Code Snippets

API Client Class

import httpx
from typing import Optional, Dict, Any

class APIClient:
    def __init__(self, base_url: str, api_key: str):
        self.base_url = base_url
        self.client = httpx.Client(
            base_url=base_url,
            headers={'Authorization': f'Bearer {api_key}'},
            timeout=30.0
        )

    def get(self, endpoint: str, params: Optional[Dict] = None) -> Dict[Any, Any]:
        response = self.client.get(endpoint, params=params)
        response.raise_for_status()
        return response.json()

    def post(self, endpoint: str, data: Dict[Any, Any]) -> Dict[Any, Any]:
        response = self.client.post(endpoint, json=data)
        response.raise_for_status()
        return response.json()

    def close(self):
        self.client.close()

    def __enter__(self):
        return self

    def __exit__(self, exc_type, exc_val, exc_tb):
        self.close()

# Usage
with APIClient('https://api.example.com', 'your-api-key') as client:
    users = client.get('/users')
    new_user = client.post('/users', {'name': 'John', 'email': 'john@example.com'})

Async API Client

import httpx
from typing import Optional, Dict, Any

class AsyncAPIClient:
    def __init__(self, base_url: str, api_key: str):
        self.base_url = base_url
        self.client = httpx.AsyncClient(
            base_url=base_url,
            headers={'Authorization': f'Bearer {api_key}'},
            timeout=30.0
        )

    async def get(self, endpoint: str, params: Optional[Dict] = None) -> Dict[Any, Any]:
        response = await self.client.get(endpoint, params=params)
        response.raise_for_status()
        return response.json()

    async def close(self):
        await self.client.aclose()

    async def __aenter__(self):
        return self

    async def __aexit__(self, exc_type, exc_val, exc_tb):
        await self.close()

# Usage
async def main():
    async with AsyncAPIClient('https://api.example.com', 'your-api-key') as client:
        users = await client.get('/users')
        print(users)

Requirements

httpx>=0.24.0
# Optional dependencies for additional features:
# httpx-ws>=0.6.0  # WebSocket support
# tqdm>=4.65.0     # Progress bars
# anyio>=3.7.0     # Alternative async runtime
# trio>=0.22.0     # Alternative async runtime

Key Features

  • Sync and Async APIs: Same interface for both synchronous and asynchronous code
  • HTTP/2 Support: Full HTTP/2 support with multiplexing
  • Connection Pooling: Efficient connection management
  • Streaming: Stream requests and responses without loading everything into memory
  • Authentication: Built-in support for Basic, Digest, Bearer token, and custom auth
  • Timeouts: Configurable timeouts for connect, read, and overall requests
  • Redirect Handling: Configurable redirect following
  • Cookie Handling: Automatic cookie management
  • Proxy Support: HTTP and HTTPS proxy support
  • SSL/TLS: Full SSL/TLS configuration options

Installation

pip install httpx

# For HTTP/2 support
pip install httpx[http2]

# For WebSocket support
pip install httpx-ws

This skill provides comprehensive HTTP client capabilities for modern Python applications, with excellent async support and production-ready features.

平台分布

Antigravity

28.17%
按下载量换算77

windsurf

25.38%
按下载量换算69

Claude Code

17.22%
按下载量换算47

Gemini CLI

12.47%
按下载量换算34

github-copilot

7.97%
按下载量换算22

trae

3.64%
按下载量换算10

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。

继续浏览同类 Skills