View source: R/process_response.R
paginate | R Documentation |
The Canvas headers include a link object (usually), in form:
Link:
<https://canvas.url/api/v1/[...]?page=1&per_page=10>; rel="current",
<https://canvas.url/api/v1/[...]?page=2&per_page=10>; rel="next",
<https://canvas.url/api/v1/[...]?page=1&per_page=10>; rel="first",
<https://canvas.url/api/v1/[...]?page=15&per_page=10>; rel="last"
In this case, we need to download every page from 1 to 15 to capture all data. This function parses the response object intelligently, using only HEAD requests, to figure out these page requirements.
paginate(x, showProgress = T)
x |
a httr response object |
showProgress |
if TRUE (default), show a textual progress bar |
unparsed responses
## Not run: resp <- canvas_query(url, args, "HEAD")
get_pages(resp)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.