Description Usage Arguments Value Author(s) See Also
Minimal wrapper to work with REST APIs.
This is an extremely minimal client. You need to know the API to be able to use this client. All this function does is:
Try to substitute each listed parameter into endpoint
, using the
:parameter
notation.
If a GET request (the default), then add all other listed parameters as query parameters.
If not a GET request, then send the other parameters in the request body, as JSON.
Convert the response to an R list using jsonlite::fromJSON()
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
endpoint |
API endpoint. Must be one of the following forms:
If the method is not supplied, will use |
... |
Name-value pairs giving API parameters. Will be matched
into |
per_page |
Number of items to return per page. If omitted,
will be substituted by |
.token |
Authentication token. Defaults to |
.destfile |
path to write response to disk. If NULL (default), response will be processed and returned as an object. If path is given, response will be written to disk in the form sent. |
.overwrite |
if |
.api_url |
Github API url (default: https://api.github.com). Used
if |
.method |
HTTP method to use if not explicitly supplied in the
|
.limit |
Number of records to return. This can be used
instead of manual pagination. By default it is |
.accept |
The value of the |
.send_headers |
Named character vector of header field values
(except |
.progress |
Whether to show a progress indicator for calls that need more than one HTTP request. |
Answer from the API as a rest_response
object, which is also a
list
. Failed requests will generate an R error. Requests that
generate a raw response will return a raw vector.
Maintainer: Gábor Csárdi csardi.gabor@gmail.com [contributor]
Authors:
Jennifer Bryan
Hadley Wickham
Useful links:
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.