获取新闻列表
易安在线
获取新闻列表并分页
默认每页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
{
"page":1,
}
cURL Example
curl -X GET -H 'Authorization: Token 2d098c9d23ac512a4d175e31f38ef9c2708acf58' http://localhost:8000/news/news_list/?page=2
JSON Reponse
{
"count":30,
"next":"http://localhost:8000/news/news_list/?page=3",
"previous":"http://localhost:8000/news/news_list/",
"results":[{
"pk":20,
"author":"fyb",
"title":"hello-world-news",
"content":"hello,world!",
"click":"0",
"create_time":"2016-04-12T10:07:38.317279Z"
},.... ]
}
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 |
创建时间 |
|