Files
RootPanel/DOC/API/READEME.md
2014-04-22 17:58:11 +08:00

21 lines
742 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## API 格式
请求和响应均为 `application/json` 格式,大部分 API 均为 POST 方式。
响应代码为 200 表示成功400 表示失败。成功会返回特定的数据,失败的响应会包含错误代号:
{
// 错误代号
"error": "username_exist"
// 根据错误代号不同,可能还有更多字段
}
## 登录验证
登录验证可通过 Cookie 和 HTTP Header 两种方式验证,后者优先级更高。
Cookie 字段名为 `token`, HTTP Header 名为 `X-TOKEN`.
验证失败时会发生 `auth_failed` 错误。
## 分页
limit 和 skip 参数用于分页limit 表示要返回的结果数量skip 表示跳过前若干条结果limit 默认为 30, skip 默认为 0.