Extracts and parses the Link header from a Canvas LMS API response, converting it into
a named vector where each rel
value (e.g., next
, first
) is a key pointing to the corresponding URL.
Value
A named vector where each name is a relation type (e.g., next, first) and its value is the URL to that relation.
Details
Possible rel
values are current
, next
, prev
, first
, last
.
Detailed documentation is at https://canvas.instructure.com/doc/api/file.pagination.html.
Examples
if (FALSE) { # \dontrun{
resp <- httr2::req_perform(canvas_api("users"))
canvas_resp_parse_links(resp)
## Returns something like:
## current
## https://example.instructure.com/api/v1/courses/1234/users?page=1&per_page=10
## first
## https://example.instructure.com/api/v1/courses/1234/users?page=1&per_page=10
## last
## https://example.instructure.com/api/v1/courses/1234/users?page=1&per_page=10
} # }