listUsers · GET /users
列出用户
GET
/api/v1/users
演示用 GET:带 query 分页与搜索。响应来自文档示例(真源 OpenAPI);本页不嵌入第三方调试器。侧栏/导航/深浅色一律沿用主题。
Query 参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
page |
query | integer | 否 | 页码,默认 1,最小 1 |
q |
query | string | 否 | 搜索关键字 |
token |
header | string | 必填 | 演示必填微标(浅底方章甲案) |
请求示例
curl(静态生成;本页无试调表单)
curl -sS 'https://api.example.com/api/v1/users?page=1&q=demo' \
-H 'X-Demo-Key: YOUR_KEY'
fetch
fetch('https://api.example.com/api/v1/users?page=1&q=demo', {
headers: { 'X-Demo-Key': 'YOUR_KEY' }
}).then(r => r.json())
响应
200 成功
{
"args": { "page": "1", "q": "demo" },
"url": "https://api.example.com/api/v1/users?page=1&q=demo"
}
400 参数错误
页码非法等。
创建用户
POST
/api/v1/users
POST 徽章 stub:跟阅读壳同安静度。
参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
name |
body | string | 必填 | 用户名 |
curl
curl -sS -X POST 'https://api.example.com/api/v1/users' \
-H 'Content-Type: application/json' \
-H 'X-Demo-Key: YOUR_KEY' \
-d '{"name":"demo"}'
删除用户
DELETE
/api/v1/users/{id}
DELETE 左边条 muted red(甲案)。
curl
curl -sS -X DELETE 'https://api.example.com/api/v1/users/42' \
-H 'X-Demo-Key: YOUR_KEY'
这篇文档对你有帮助吗?
谢谢你的反馈!