Commit d415bf72 authored by Evan Read's avatar Evan Read

Merge branch 'mpower-master-patch-51159' into 'master'

Update API Pagination response headers

See merge request gitlab-org/gitlab!45301
parents 9ba91daf 92a1f62a
...@@ -378,22 +378,22 @@ curl --head --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.exampl ...@@ -378,22 +378,22 @@ curl --head --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.exampl
The response will then be: The response will then be:
```http ```http
HTTP/1.1 200 OK HTTP/2 200 OK
Cache-Control: no-cache cache-control: no-cache
Content-Length: 1103 content-length: 1103
Content-Type: application/json content-type: application/json
Date: Mon, 18 Jan 2016 09:43:18 GMT date: Mon, 18 Jan 2016 09:43:18 GMT
Link: <https://gitlab.example.com/api/v4/projects/8/issues/8/notes?page=1&per_page=3>; rel="prev", <https://gitlab.example.com/api/v4/projects/8/issues/8/notes?page=3&per_page=3>; rel="next", <https://gitlab.example.com/api/v4/projects/8/issues/8/notes?page=1&per_page=3>; rel="first", <https://gitlab.example.com/api/v4/projects/8/issues/8/notes?page=3&per_page=3>; rel="last" link: <https://gitlab.example.com/api/v4/projects/8/issues/8/notes?page=1&per_page=3>; rel="prev", <https://gitlab.example.com/api/v4/projects/8/issues/8/notes?page=3&per_page=3>; rel="next", <https://gitlab.example.com/api/v4/projects/8/issues/8/notes?page=1&per_page=3>; rel="first", <https://gitlab.example.com/api/v4/projects/8/issues/8/notes?page=3&per_page=3>; rel="last"
Status: 200 OK status: 200 OK
Vary: Origin vary: Origin
X-Next-Page: 3 x-next-page: 3
X-Page: 2 x-page: 2
X-Per-Page: 3 x-per-page: 3
X-Prev-Page: 1 x-prev-page: 1
X-Request-Id: 732ad4ee-9870-4866-a199-a9db0cde3c86 x-request-id: 732ad4ee-9870-4866-a199-a9db0cde3c86
X-Runtime: 0.108688 x-runtime: 0.108688
X-Total: 8 x-total: 8
X-Total-Pages: 3 x-total-pages: 3
``` ```
#### Other pagination headers #### Other pagination headers
...@@ -402,12 +402,12 @@ GitLab also returns the following additional pagination headers: ...@@ -402,12 +402,12 @@ GitLab also returns the following additional pagination headers:
| Header | Description | | Header | Description |
| --------------- | --------------------------------------------- | | --------------- | --------------------------------------------- |
| `X-Total` | The total number of items | | `x-total` | The total number of items |
| `X-Total-Pages` | The total number of pages | | `x-total-pages` | The total number of pages |
| `X-Per-Page` | The number of items per page | | `x-per-page` | The number of items per page |
| `X-Page` | The index of the current page (starting at 1) | | `x-page` | The index of the current page (starting at 1) |
| `X-Next-Page` | The index of the next page | | `x-next-page` | The index of the next page |
| `X-Prev-Page` | The index of the previous page | | `X-prev-page` | The index of the previous page |
NOTE: **Note:** NOTE: **Note:**
For GitLab.com users, [some pagination headers may not be returned](../user/gitlab_com/index.md#pagination-response-headers). For GitLab.com users, [some pagination headers may not be returned](../user/gitlab_com/index.md#pagination-response-headers).
......
...@@ -542,9 +542,9 @@ Source: ...@@ -542,9 +542,9 @@ Source:
For performance reasons, if a query returns more than 10,000 records, GitLab For performance reasons, if a query returns more than 10,000 records, GitLab
doesn't return the following headers: doesn't return the following headers:
- `X-Total`. - `x-total`.
- `X-Total-Pages`. - `x-total-pages`.
- `rel="last"` `Link`. - `rel="last"` `link`.
### Rack Attack initializer ### Rack Attack initializer
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment