[关闭]
@fuyb1986 2017-02-27T01:43:31.000000Z 字数 1292 阅读 1238

每日一星收藏

金色童年


收藏每日一星

Method and URL Structure

Method Resource URL
POST /comment/post/collect/

Request Parameters

Name Decription Required
post 每日一星 post_id True

cURL Example

  1. curl -X POST -H 'Content-Type: application/json' -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\ --data '{...}' \
  2. http://localhost/comment/post/collect/?post=34

取消收藏每日一星

Method and URL Structure

Method Resource URL
DELETE /comment/post/collect/delete/

Request Parameters

Name Decription Required
post 每日一星 post_id True

cURL Example

  1. curl -X DELETE -H 'Content-Type: application/json' -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\
  2. http://localhost/comment/post/collect/delete/?post=34

收藏统计

Method and URL Structure

Method Resource URL Decription
GET /comment/post/collect/statistics/

Request Parameters

Name Decription Required
post 每日一星 post_id True

cURL Example

  1. curl http://localhost/comment/post/collect/statistics/?post=13469

Response

  1. {
  2. "count":2,
  3. "has_collect": true,
  4. }

用户的每日一星收藏列表

Method and URL Structure

Method Resource URL Decription
GET /comment/post/collects/

Request Parameters

Name Decription Required
collect_type 类型: star_baby True

cURL Example

  1. curl http://localhost/comment/post/collects/?collect_type=star_baby

Response

  1. {
  2. "count":1,
  3. "next":null,
  4. "previous":null,
  5. "results":[{
  6. "pk":4,
  7. "owner":8,
  8. "post":{
  9. "pk":9,
  10. "title":"独怆然而泪下",
  11. "published":"2017-02-23"
  12. },
  13. "created":"2017-02-23T18:03:45.551346"
  14. }]
  15. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注