Files
Luong NGUYEN 89e89d4aa3 feat(zh): add Chinese translations in zh/ directory
Add Chinese (Simplified) translations for all documentation, organized
under a dedicated zh/ directory that mirrors the English folder structure.

Co-authored-by: tanqingkuang <tanqingkuang@users.noreply.github.com>

Translations originally contributed by @tanqingkuang in #45.
Restructured from *-CN.md suffix pattern into zh/ directory to prevent
the EPUB builder (scripts/build_epub.py collect_folder_files) from
picking up Chinese files via glob("*.md") inside module folders.
2026-04-06 23:08:54 +02:00

1.6 KiB
Raw Permalink Blame History

[方法] /api/v1/[endpoint]

描述

简要说明这个端点的作用。

身份验证

所需的身份验证方式,例如 Bearer token。

参数

路径参数

名称 类型 必填 描述
id string 资源 ID

查询参数

名称 类型 必填 描述
page integer 页码(默认:1
limit integer 每页条数(默认:20

请求体

{
  "field": "value"
}

响应

200 OK

{
  "success": true,
  "data": {
    "id": "123",
    "name": "示例"
  }
}

400 Bad Request

{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "无效输入"
  }
}

404 Not Found

{
  "success": false,
  "error": {
    "code": "NOT_FOUND",
    "message": "资源未找到"
  }
}

示例

cURL

curl -X GET "https://api.example.com/api/v1/endpoint" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json"

JavaScript

const response = await fetch('/api/v1/endpoint', {
  headers: {
    'Authorization': 'Bearer token',
    'Content-Type': 'application/json'
  }
});
const data = await response.json();

Python

import requests

response = requests.get(
    'https://api.example.com/api/v1/endpoint',
    headers={'Authorization': 'Bearer token'}
)
data = response.json()

限流

  • 已认证用户每小时 1000 次请求
  • 公开端点每小时 100 次请求

相关端点