- 用户接口
- 关注分组
- 发帖管理接口
- 分区接口
- 评论接口
- 评论回复接口
- 收藏接口
- 点赞接口
- 搜索及统计相关接口
- ws接口
新增收藏
测试中
POST
/collections/add
最后修改时间:2022-03-06 14:22:22
责任人:cosine_yu
请求参数
Authorization
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token示例:
Authorization: Bearer ********************
Body 参数application/json
article_id
integer
文章ID
示例
{
"article_id": 2
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://cosine.ren:8000/collections/add' \
--header 'Content-Type: application/json' \
--data-raw '{
"article_id": 2
}'
返回响应
🟢200成功
application/json
Body
code
integer
必需
message
string
必需
result
object
必需
collection_id
integer
必需
user_id
integer
必需
article_id
integer
必需
示例
{
"code": 0,
"message": "收藏成功!",
"result": {
"collection_id": 4,
"user_id": 1,
"article_id": 3
}
}
🟠409Conflict
修改于 2022-03-06 14:22:22