View source: R/brainmaps-api.R
brainmaps_fetch | R Documentation |
brainmaps_fetch
calls the brainmaps API with optional
request cache and retries.
brainmaps_clear_cache
clears the cache used by brainmaps_fetch
brainmaps_fetch(
url,
body = NULL,
parse.json = TRUE,
cache = FALSE,
retry = 0L,
include_headers = FALSE,
simplifyVector = TRUE,
...
)
brainmaps_clear_cache()
url |
Full URL for brainmaps API endpoint |
body |
an R list with parameters that will be converted with
|
parse.json |
Whether or not to parse a JSON response to an R object
(default |
cache |
Whether or not to cache responses (default |
retry |
The number of times to retry the operation (default 0,
|
include_headers |
Whether to include basic headers from the http request
as attributes on the parsed JSON object (default |
simplifyVector |
Whether to use |
... |
additional arguments passed to the |
An R list parse
## Not run:
brainmaps_fetch("https://brainmaps.googleapis.com/v1/volumes")
# retry up to 4 times on failure
brainmaps_fetch("https://brainmaps.googleapis.com/v1/volumes", retry=4)
# cache results
brainmaps_fetch("https://brainmaps.googleapis.com/v1/volumes", cache=TRUE)
# use arbitrary curl/httr options (see httr_options())
httr::with_config(httr::verbose(), {
brainmaps_fetch("https://brainmaps.googleapis.com/v1/volumes")
})
## End(Not run)
brainmaps_clear_cache()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.