ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
**可分页接口的URL简介** **(Response) 返回的列表数据分页信息在header里:** <pre> X-Current-Page → 1 当前页 X-Item-Count → 30 总记录条数 X-Last-Page → 2 总页数(最后一页) X-Per-Page → 20 当前分页大小(每页多少条) X-Query-Offset → 42 当前的offset值 Link → 第一页,下一个,最后一页 </pre> 示例: ``` Cache-Control → private, must-revalidate Connection → Connection Options that are desired for the connection close Date → Wed, 14 Oct 2015 02:37:39 GMT ETag → "53d853ee196dd13262c920633e9864ab" Host → localhost:8000 Link → <http://localhost:8000/tasks/?type=0&user_id=10514&page=1>; rel="first",<http://localhost:8000/tasks/?type=0&user_id=10514&page=1>; rel="last" X-Current-Page → 1 X-Item-Count → 8 X-Last-Page → 1 X-Per-Page → 15 X-Powered-By → PHP/5.5.23 X-Query-Offset → 2 X-Total-Count → 8 X-Total-Page → 1 content-type → application/json;charset=utf-8 ``` **(Request)分页请求参数** 有两种分页方式:按页码、按id(offset,建议使用这种) 按page: ?page=2 按offset: ?offset=42 (上一次ID最小的) 每页拉30条? per_page=30