[关闭]
@fuyb1986 2016-04-12T10:27:19.000000Z 字数 790 阅读 529

获取新闻列表

易安在线


获取新闻列表并分页

默认每页10条

Method and URL Structure

Method Resource URL
GET /account/news/news_list/

Request Parmaeters

Name Description Required Default
page page number YES 1

Request

  1. {
  2. "page":1,
  3. }

cURL Example

  1. curl -X GET -H 'Authorization: Token 2d098c9d23ac512a4d175e31f38ef9c2708acf58' http://localhost:8000/news/news_list/?page=2

JSON Reponse

  1. {
  2. "count":30,
  3. "next":"http://localhost:8000/news/news_list/?page=3",
  4. "previous":"http://localhost:8000/news/news_list/",
  5. "results":[{
  6. "pk":20,
  7. "author":"fyb",
  8. "title":"hello-world-news",
  9. "content":"hello,world!",
  10. "click":"0",
  11. "create_time":"2016-04-12T10:07:38.317279Z"
  12. },.... ]
  13. }

Reponse Description

Name Description Note
count news总量
next 下一页URL 无下页值为null
previous 上一页URL 无上页值为null; 首页无"?page=1"
results 资源集 每个成员是一个news

News Description

Name Description Note
pk ID/pk
author 作者
title 标题
conent 内容
click 点击量
create_time 创建时间
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注