[关闭]
@fuyb1986 2016-11-10T10:45:01.000000Z 字数 1204 阅读 573

照片收藏

金色童年


收藏、取消收藏照片

Method and URL Structure

Method Resource URL
POST /photograph/collect/${photograph pk}/
DELETE /photograph/collections/remove/${photograph pk}/

cURL Example

  1. curl -X POST -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\
  2. -H 'Content-Type: Application/json' http://localhost/photograph/collect/\$\$photograph pk\}/

Reponse

  1. {
  2. "pk":1,
  3. "collection":12,
  4. "photograph":{
  5. "pk":24,
  6. "title":"xiaoming's photo",
  7. "desc":"南柯郡汶汶乡大槐树",
  8. "file_url":"http://www.example.com/1.jpg",
  9. "taken_date":"2016-07-01",
  10. "author":"布可朔夫",
  11. "created":"2016-10-26T20:30:34.964312",
  12. "albums":[{
  13. "album":"27",
  14. "name":"未分类",
  15. "created":"2016-10-26T20:30:34.951501"
  16. }]
  17. }
  18. }

收藏列表

Method and URL Structure

Method Resource URL
GET /photograph/collections/

cURL Example

  1. curl -X POST -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\
  2. -H 'Content-Type: Application/json' http://localhost/photograph/collections/

Reponse

  1. {
  2. "count":1,
  3. "next":null,
  4. "previous":null,
  5. "results":[{
  6. "pk":1,
  7. "collection":12,
  8. "photograph":{
  9. "pk":24,
  10. "title":"xiaoming's photo",
  11. "desc":"南柯郡汶汶乡大槐树",
  12. "file_url":"http://www.example.com/1.jpg",
  13. "taken_date":"2016-07-01",
  14. "author":"布可朔夫",
  15. "created":"2016-10-26T20:32:51.450770",
  16. "albums":[{
  17. "album":"27",
  18. "name":"未分类",
  19. "created":"2016-10-26T20:32:51.437680"
  20. }]
  21. }
  22. }....]
  23. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注