Argumentsrequest for the next page or NULL
if
-the iteration should terminate. See below for more details.
+An optional function that takes the previous response
+(resp
) to generate the next request in a call to
+httr2::req_perform_iterative()
. This function can usually be generated
+using one of the iteration helpers described in
+httr2::iterate_with_offset()
.
max_reqs
diff --git a/reference/security_api_key.html b/reference/security_api_key.html
index 735c697..a16839d 100644
--- a/reference/security_api_key.html
+++ b/reference/security_api_key.html
@@ -42,7 +42,7 @@
diff --git a/search.json b/search.json
index adc2eab..11512f3 100644
--- a/search.json
+++ b/search.json
@@ -1 +1 @@
-[{"path":[]},{"path":"https://nectar.api2r.org/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://nectar.api2r.org/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://nectar.api2r.org/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://nectar.api2r.org/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://nectar.api2r.org/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement jonthegeek@gmail.com. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://nectar.api2r.org/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://nectar.api2r.org/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://nectar.api2r.org/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://nectar.api2r.org/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://nectar.api2r.org/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://nectar.api2r.org/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.1, available https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. Community Impact Guidelines inspired [Mozilla’s code conduct enforcement ladder][https://github.com/mozilla/inclusion]. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https://www.contributor-covenant.org/translations.","code":""},{"path":"https://nectar.api2r.org/CONTRIBUTING.html","id":null,"dir":"","previous_headings":"","what":"Contributing to nectar","title":"Contributing to nectar","text":"outlines propose change nectar.","code":""},{"path":"https://nectar.api2r.org/CONTRIBUTING.html","id":"fixing-typos","dir":"","previous_headings":"","what":"Fixing typos","title":"Contributing to nectar","text":"can fix typos, spelling mistakes, grammatical errors documentation directly using GitHub web interface, long changes made source file. generally means ’ll need edit roxygen2 comments .R, .Rd file. can find .R file generates .Rd reading comment first line.","code":""},{"path":"https://nectar.api2r.org/CONTRIBUTING.html","id":"bigger-changes","dir":"","previous_headings":"","what":"Bigger changes","title":"Contributing to nectar","text":"want make bigger change, ’s good idea first file issue make sure someone team agrees ’s needed. ’ve found bug, please file issue illustrates bug minimal reprex (also help write unit test, needed).","code":""},{"path":"https://nectar.api2r.org/CONTRIBUTING.html","id":"pull-request-process","dir":"","previous_headings":"Bigger changes","what":"Pull request process","title":"Contributing to nectar","text":"Fork package clone onto computer. haven’t done , recommend using usethis::create_from_github(\"jonthegeek/nectar\", fork = TRUE). Install development dependencies devtools::install_dev_deps(), make sure package passes R CMD check running devtools::check(). R CMD check doesn’t pass cleanly, ’s good idea ask help continuing. Create Git branch pull request (PR). recommend using usethis::pr_init(\"brief-description--change\"). Make changes, commit git, create PR running usethis::pr_push(), following prompts browser. title PR briefly describe change. body PR contain Fixes #issue-number. user-facing changes, add bullet top NEWS.md (.e. just first header). Follow style described https://style.tidyverse.org/news.html.","code":""},{"path":"https://nectar.api2r.org/CONTRIBUTING.html","id":"code-style","dir":"","previous_headings":"Bigger changes","what":"Code style","title":"Contributing to nectar","text":"New code follow tidyverse style guide. can use styler package apply styles, please don’t restyle code nothing PR. use roxygen2, Markdown syntax, documentation. use testthat unit tests. Contributions test cases included easier accept.","code":""},{"path":"https://nectar.api2r.org/CONTRIBUTING.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Contributing to nectar","text":"Please note nectar project released Contributor Code Conduct. contributing project agree abide terms.","code":""},{"path":"https://nectar.api2r.org/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2023 nectar authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://nectar.api2r.org/SUPPORT.html","id":null,"dir":"","previous_headings":"","what":"Getting help with nectar","title":"Getting help with nectar","text":"Thanks using nectar! filing issue, places explore pieces put together make process smooth possible.","code":""},{"path":"https://nectar.api2r.org/SUPPORT.html","id":"make-a-reprex","dir":"","previous_headings":"","what":"Make a reprex","title":"Getting help with nectar","text":"Start making minimal reproducible example using reprex package. haven’t heard used reprex , ’re treat! Seriously, reprex make R-question-asking endeavors easier (pretty insane ROI five ten minutes ’ll take learn ’s ). additional reprex pointers, check Get help! section tidyverse site.","code":""},{"path":"https://nectar.api2r.org/SUPPORT.html","id":"where-to-ask","dir":"","previous_headings":"","what":"Where to ask?","title":"Getting help with nectar","text":"Armed reprex, next step figure ask. ’s question: ’s best ask R4DS Online Learning Community Slack. options include Posit Community, StackOverflow. people answer questions. ’s bug: ’re right place, file issue. ’re sure: let community help figure ! problem bug feature request, can easily return report . opening new issue, sure search issues pull requests make sure bug hasn’t reported /already fixed development version. default, search pre-populated :issue :open. can edit qualifiers (e.g. :pr, :closed) needed. example, ’d simply remove :open search issues repo, open closed.","code":""},{"path":"https://nectar.api2r.org/SUPPORT.html","id":"what-happens-next","dir":"","previous_headings":"","what":"What happens next?","title":"Getting help with nectar","text":"’ll try look issue soon can, packages maintained volunteers. good reprex particularly important might weeks months initial report start working . can’t reproduce bug, can’t fix !","code":""},{"path":"https://nectar.api2r.org/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Jon Harmon. Author, maintainer, copyright holder. R Consortium. Funder.","code":""},{"path":"https://nectar.api2r.org/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Harmon J (2024). nectar: Framework Web API Packages. R package version 0.0.0.9002, https://github.com/jonthegeek/nectar, https://nectar.api2r.org.","code":"@Manual{, title = {nectar: A Framework for Web API Packages}, author = {Jon Harmon}, year = {2024}, note = {R package version 0.0.0.9002, https://github.com/jonthegeek/nectar}, url = {https://nectar.api2r.org}, }"},{"path":"https://nectar.api2r.org/index.html","id":"nectar-","dir":"","previous_headings":"","what":"A Framework for Web API Packages","title":"A Framework for Web API Packages","text":"opinionated framework use within api-wrapping R packages.","code":""},{"path":"https://nectar.api2r.org/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"A Framework for Web API Packages","text":"can install development version nectar GitHub :","code":"# install.packages(\"remotes\") remotes::install_github(\"jonthegeek/nectar\")"},{"path":"https://nectar.api2r.org/index.html","id":"usage","dir":"","previous_headings":"","what":"Usage","title":"A Framework for Web API Packages","text":"Add usage information examples .","code":""},{"path":"https://nectar.api2r.org/index.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"A Framework for Web API Packages","text":"Please note nectar project released Contributor Code Conduct. contributing project, agree abide terms.","code":""},{"path":"https://nectar.api2r.org/reference/call_api.html","id":null,"dir":"Reference","previous_headings":"","what":"Send a request to an API — call_api","title":"Send a request to an API — call_api","text":"function implements opinionated framework making API calls. intended used inside API client package. serves wrapper around req_ family functions, httr2::request(), well httr2::req_perform() httr2::req_perform_iterative(), , default, httr2::resp_body_json().","code":""},{"path":"https://nectar.api2r.org/reference/call_api.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Send a request to an API — call_api","text":"","code":"call_api( base_url, path = NULL, query = NULL, body = NULL, mime_type = NULL, method = NULL, security_fn = NULL, security_args = list(), response_parser = httr2::resp_body_json, response_parser_args = list(), next_req = NULL, max_reqs = Inf, max_tries_per_req = 3, user_agent = \"nectar (https://nectar.api2r.org)\" )"},{"path":"https://nectar.api2r.org/reference/call_api.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Send a request to an API — call_api","text":"base_url part url shared calls API. cases may family base URLs, need choose one. path route API endpoint. Optionally, list path plus variables glue::glue() path. query optional list parameters pass query portion request. body object use body request. component body path, pass fs::path() otherwise give class \"fs_path\" indicate path. mime_type character scalar indicating mime type files present body. APIs allow leave NULL guess. method method something GET POST, supply . Case ignored. security_fn function use authenticate request. default (NULL), authentication performed. security_args optional list arguments security_fn function. response_parser function parse server response (resp). Defaults httr2::resp_body_json(), since JSON responses common. Set NULL return raw response httr2::req_perform(). response_parser_args optional list arguments pass response_parser function (addition resp). next_req optional function takes previous response (resp) generate next request call httr2::req_perform_iterative(). function can usually generated using one iteration helpers described httr2::iterate_with_offset(). max_reqs maximum number separate requests perform. Passed max_reqs argument httr2::req_perform_iterative() next_req supplied. default 2 likely changed Inf validate function. max_tries_per_req maximum number times attempt individual request. Passed max_tries argument httr2::req_retry(). user_agent string identify request coming . polite set user agent identify package, \"MyPackage (https://mypackage.com)\".","code":""},{"path":"https://nectar.api2r.org/reference/call_api.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Send a request to an API — call_api","text":"response API, parsed response_parser.","code":""},{"path":"https://nectar.api2r.org/reference/compact_nested_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Discard empty elements — compact_nested_list","title":"Discard empty elements — compact_nested_list","text":"Discard empty elements nested lists.","code":""},{"path":"https://nectar.api2r.org/reference/compact_nested_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Discard empty elements — compact_nested_list","text":"","code":"compact_nested_list(lst)"},{"path":"https://nectar.api2r.org/reference/compact_nested_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Discard empty elements — compact_nested_list","text":"lst (nested) list filter.","code":""},{"path":"https://nectar.api2r.org/reference/compact_nested_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Discard empty elements — compact_nested_list","text":"list, minus empty elements branches.","code":""},{"path":"https://nectar.api2r.org/reference/compact_nested_list.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Discard empty elements — compact_nested_list","text":"","code":"x <- list( a = list( b = letters, c = NULL, d = 1:5 ), e = NULL, f = 1:3 ) compact_nested_list(x) #> $a #> $a$b #> [1] \"a\" \"b\" \"c\" \"d\" \"e\" \"f\" \"g\" \"h\" \"i\" \"j\" \"k\" \"l\" \"m\" \"n\" \"o\" \"p\" \"q\" \"r\" \"s\" #> [20] \"t\" \"u\" \"v\" \"w\" \"x\" \"y\" \"z\" #> #> $a$d #> [1] 1 2 3 4 5 #> #> #> $f #> [1] 1 2 3 #>"},{"path":"https://nectar.api2r.org/reference/dot-compact_nested_list_impl.html","id":null,"dir":"Reference","previous_headings":"","what":"Discard empty elements — .compact_nested_list_impl","title":"Discard empty elements — .compact_nested_list_impl","text":"Discard empty elements","code":""},{"path":"https://nectar.api2r.org/reference/dot-compact_nested_list_impl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Discard empty elements — .compact_nested_list_impl","text":"","code":".compact_nested_list_impl(lst, depth = 1L)"},{"path":"https://nectar.api2r.org/reference/dot-compact_nested_list_impl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Discard empty elements — .compact_nested_list_impl","text":"lst (nested) list filter. depth current recursion depth.","code":""},{"path":"https://nectar.api2r.org/reference/dot-compact_nested_list_impl.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Discard empty elements — .compact_nested_list_impl","text":"list, minus empty elements branches.","code":""},{"path":"https://nectar.api2r.org/reference/dot-req_body_auto.html","id":null,"dir":"Reference","previous_headings":"","what":"Send data in request body — .req_body_auto","title":"Send data in request body — .req_body_auto","text":"Automatically choose httr2::req_body_json() httr2::req_body_multipart() based content body. currently experimental needs tested APIs.","code":""},{"path":"https://nectar.api2r.org/reference/dot-req_body_auto.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Send data in request body — .req_body_auto","text":"","code":".req_body_auto(req, body, mime_type = NULL)"},{"path":"https://nectar.api2r.org/reference/dot-req_body_auto.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Send data in request body — .req_body_auto","text":"req httr2::request() object. body object use body request. component body path, pass fs::path() otherwise give class \"fs_path\" indicate path. mime_type character scalar indicating mime type files present body. APIs allow leave NULL guess.","code":""},{"path":"https://nectar.api2r.org/reference/dot-req_body_auto.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Send data in request body — .req_body_auto","text":"modified HTTP request.","code":""},{"path":"https://nectar.api2r.org/reference/dot-security_api_key_cookie.html","id":null,"dir":"Reference","previous_headings":"","what":"Authenticate with an API key in a cookie — .security_api_key_cookie","title":"Authenticate with an API key in a cookie — .security_api_key_cookie","text":"Authenticate API key cookie","code":""},{"path":"https://nectar.api2r.org/reference/dot-security_api_key_cookie.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Authenticate with an API key in a cookie — .security_api_key_cookie","text":"","code":".security_api_key_cookie(req, ..., path)"},{"path":"https://nectar.api2r.org/reference/dot-security_api_key_cookie.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Authenticate with an API key in a cookie — .security_api_key_cookie","text":"req httr2::request() object. path path cookie.","code":""},{"path":"https://nectar.api2r.org/reference/dot-security_api_key_cookie.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Authenticate with an API key in a cookie — .security_api_key_cookie","text":"httr2::request() object.","code":""},{"path":"https://nectar.api2r.org/reference/dot-security_api_key_header.html","id":null,"dir":"Reference","previous_headings":"","what":"Authenticate with an API key in the header of the request — .security_api_key_header","title":"Authenticate with an API key in the header of the request — .security_api_key_header","text":"Authenticate API key header request","code":""},{"path":"https://nectar.api2r.org/reference/dot-security_api_key_header.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Authenticate with an API key in the header of the request — .security_api_key_header","text":"","code":".security_api_key_header(req, ..., parameter_name, api_key)"},{"path":"https://nectar.api2r.org/reference/dot-security_api_key_header.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Authenticate with an API key in the header of the request — .security_api_key_header","text":"req httr2::request() object. parameter_name name use API key. api_key API key use.","code":""},{"path":"https://nectar.api2r.org/reference/dot-security_api_key_header.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Authenticate with an API key in the header of the request — .security_api_key_header","text":"httr2::request() object.","code":""},{"path":"https://nectar.api2r.org/reference/dot-shared-parameters.html","id":null,"dir":"Reference","previous_headings":"","what":"Parameters used in multiple functions — .shared-parameters","title":"Parameters used in multiple functions — .shared-parameters","text":"Reused parameter definitions gathered easier editing.","code":""},{"path":"https://nectar.api2r.org/reference/dot-shared-parameters.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Parameters used in multiple functions — .shared-parameters","text":"base_url part url shared calls API. cases may family base URLs, need choose one. body object use body request. component body path, pass fs::path() otherwise give class \"fs_path\" indicate path. case case standard apply. possible values self-descriptive. Defaults \"snake_case\". depth current recursion depth. method method something GET POST, supply . Case ignored. mime_type character scalar indicating mime type files present body. APIs allow leave NULL guess. path route API endpoint. Optionally, list path plus variables glue::glue() path. query optional list parameters pass query portion request. req httr2::request() object. response_parser function parse server response (resp). Defaults httr2::resp_body_json(), since JSON responses common. Set NULL return raw response httr2::req_perform(). security_fn function use authenticate request. default (NULL), authentication performed. security_args optional list arguments security_fn function. user_agent string identify request coming . polite set user agent identify package, \"MyPackage (https://mypackage.com)\". x object update.","code":""},{"path":"https://nectar.api2r.org/reference/dot-shared-request.html","id":null,"dir":"Reference","previous_headings":"","what":"Returns from request functions — .shared-request","title":"Returns from request functions — .shared-request","text":"Returns request functions","code":""},{"path":"https://nectar.api2r.org/reference/dot-shared-request.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Returns from request functions — .shared-request","text":"httr2::request() object.","code":""},{"path":"https://nectar.api2r.org/reference/nectar-package.html","id":null,"dir":"Reference","previous_headings":"","what":"nectar: A Framework for Web API Packages — nectar-package","title":"nectar: A Framework for Web API Packages — nectar-package","text":"opinionated framework use within api-wrapping R packages.","code":""},{"path":[]},{"path":"https://nectar.api2r.org/reference/nectar-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"nectar: A Framework for Web API Packages — nectar-package","text":"Maintainer: Jon Harmon jonthegeek@gmail.com (ORCID) [copyright holder] contributors: R Consortium [funder]","code":""},{"path":"https://nectar.api2r.org/reference/req_perform_opinionated.html","id":null,"dir":"Reference","previous_headings":"","what":"Perform a request with opinionated defaults — req_perform_opinionated","title":"Perform a request with opinionated defaults — req_perform_opinionated","text":"function ensures request httr2::req_retry() applied, performs request, using either httr2::req_perform_iterative() (next_req function supplied) httr2::req_perform() ().","code":""},{"path":"https://nectar.api2r.org/reference/req_perform_opinionated.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Perform a request with opinionated defaults — req_perform_opinionated","text":"","code":"req_perform_opinionated( req, ..., next_req = NULL, max_reqs = 2, max_tries_per_req = 3 )"},{"path":"https://nectar.api2r.org/reference/req_perform_opinionated.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Perform a request with opinionated defaults — req_perform_opinionated","text":"req httr2::request() object. ... dots future extensions must empty. next_req function takes previous response (resp) request (req) returns request next page NULL iteration terminate. See details. max_reqs maximum number separate requests perform. Passed max_reqs argument httr2::req_perform_iterative() next_req supplied. default 2 likely changed Inf validate function. max_tries_per_req maximum number times attempt individual request. Passed max_tries argument httr2::req_retry().","code":""},{"path":"https://nectar.api2r.org/reference/req_perform_opinionated.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Perform a request with opinionated defaults — req_perform_opinionated","text":"list httr2::response() objects, one request performed.","code":""},{"path":"https://nectar.api2r.org/reference/req_prepare.html","id":null,"dir":"Reference","previous_headings":"","what":"Prepare a request for an API — req_prepare","title":"Prepare a request for an API — req_prepare","text":"function implements opinionated framework preparing API request. intended used inside API client package. serves wrapper around req_ family functions, httr2::request().","code":""},{"path":"https://nectar.api2r.org/reference/req_prepare.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Prepare a request for an API — req_prepare","text":"","code":"req_prepare( base_url, ..., path = NULL, query = NULL, body = NULL, mime_type = NULL, method = NULL, user_agent = \"nectar (https://nectar.api2r.org)\" )"},{"path":"https://nectar.api2r.org/reference/req_prepare.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Prepare a request for an API — req_prepare","text":"base_url part url shared calls API. cases may family base URLs, need choose one. ... dots future extensions must empty. path route API endpoint. Optionally, list path plus variables glue::glue() path. query optional list parameters pass query portion request. body object use body request. component body path, pass fs::path() otherwise give class \"fs_path\" indicate path. mime_type character scalar indicating mime type files present body. APIs allow leave NULL guess. method method something GET POST, supply . Case ignored. user_agent string identify request coming . polite set user agent identify package, \"MyPackage (https://mypackage.com)\".","code":""},{"path":"https://nectar.api2r.org/reference/req_prepare.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Prepare a request for an API — req_prepare","text":"httr2::request() object.","code":""},{"path":"https://nectar.api2r.org/reference/resp_parse.html","id":null,"dir":"Reference","previous_headings":"","what":"Parse one or more responses — resp_parse","title":"Parse one or more responses — resp_parse","text":"httr2 provides two methods performing requests: httr2::req_perform(), returns single httr2::response() object, httr2::req_perform_iterative(), returns list httr2::response() objects. function automatically determines whether single response multiple responses returned, parses responses appropriately.","code":""},{"path":"https://nectar.api2r.org/reference/resp_parse.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Parse one or more responses — resp_parse","text":"","code":"resp_parse(resp, ...) # S3 method for default resp_parse( resp, ..., arg = rlang::caller_arg(resp), call = rlang::caller_env() ) # S3 method for httr2_response resp_parse(resp, ..., response_parser = httr2::resp_body_json)"},{"path":"https://nectar.api2r.org/reference/resp_parse.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Parse one or more responses — resp_parse","text":"resp single httr2::response() object (returned httr2::req_perform()) list objects (returned httr2::req_perform_iterative()). ... Additional arguments passed response_parser function (addition resp). arg argument name string. argument mentioned error messages input origin problem. call execution environment currently running function, e.g. caller_env(). function mentioned error messages source error. See call argument abort() information. response_parser function parse server response (resp). Defaults httr2::resp_body_json(), since JSON responses common. Set NULL return raw response httr2::req_perform().","code":""},{"path":"https://nectar.api2r.org/reference/resp_parse.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Parse one or more responses — resp_parse","text":"response parsed response_parser. resp list, parsed responses concatenated. See httr2::resps_data() examples.","code":""},{"path":"https://nectar.api2r.org/reference/security_api_key.html","id":null,"dir":"Reference","previous_headings":"","what":"Authenticate with an API key — security_api_key","title":"Authenticate with an API key — security_api_key","text":"Many APIs provide API keys can used authenticate requests (, often, provide information user). function helps apply keys requests.","code":""},{"path":"https://nectar.api2r.org/reference/security_api_key.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Authenticate with an API key — security_api_key","text":"","code":"security_api_key(req, ..., location = \"header\")"},{"path":"https://nectar.api2r.org/reference/security_api_key.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Authenticate with an API key — security_api_key","text":"req httr2::request() object. ... Additional parameters depending location API key. parameter_name (\"header\" \"query\" ) name parameter use header query. api_key (\"header\" \"query\" ) API key use. path (\"cookie\" ) location cookie. location API key passed. One \"header\" (default), \"query\", \"cookie\".","code":""},{"path":"https://nectar.api2r.org/reference/security_api_key.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Authenticate with an API key — security_api_key","text":"httr2::request() object.","code":""},{"path":"https://nectar.api2r.org/reference/stabilize_string.html","id":null,"dir":"Reference","previous_headings":"","what":"Ensure an argument is a length-1 character — stabilize_string","title":"Ensure an argument is a length-1 character — stabilize_string","text":"Calls APIs often require string argument. function ensures arguments length-1, non-NA character vectors, length-1, non-NA vectors can coerced character vectors. intended ensure calls API fail predictable errors, thus avoiding unnecessary internet traffic.","code":""},{"path":"https://nectar.api2r.org/reference/stabilize_string.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Ensure an argument is a length-1 character — stabilize_string","text":"","code":"stabilize_string( x, ..., regex = NULL, arg = rlang::caller_arg(x), call = rlang::caller_env() )"},{"path":"https://nectar.api2r.org/reference/stabilize_string.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Ensure an argument is a length-1 character — stabilize_string","text":"x argument stabilize. ... Arguments passed stbl::stabilize_chr_scalar x_class Character. class name x use error messages. Use remove special class x checking coercion, want error message match original class. regex Character scalar. optional regex pattern compare value(s) x . complex regex pattern throws error, try installing stringi package install.packages(\"stringi\"). arg argument name string. argument mentioned error messages input origin problem. call execution environment currently running function, e.g. caller_env(). function mentioned error messages source error. See call argument abort() information.","code":""},{"path":"https://nectar.api2r.org/reference/stabilize_string.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Ensure an argument is a length-1 character — stabilize_string","text":"x coerced length-1 character vector, possible.","code":""},{"path":"https://nectar.api2r.org/reference/stabilize_string.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Ensure an argument is a length-1 character — stabilize_string","text":"","code":"stabilize_string(\"a\") #> [1] \"a\" stabilize_string(1.1) #> [1] \"1.1\" x <- letters try(stabilize_string(x)) #> Error in eval(expr, envir, enclos) : #> `x` must be a single . #> ✖ `x` has 26 values. x <- NULL try(stabilize_string(x)) #> Error in eval(expr, envir, enclos) : #> `x` must not be . x <- character() try(stabilize_string(x)) #> Error in eval(expr, envir, enclos) : #> `x` must be a single . #> ✖ `x` has no values. x <- NA try(stabilize_string(x)) #> Error in eval(expr, envir, enclos) : #> `x` must not contain NA values. #> • NA locations: 1"},{"path":"https://nectar.api2r.org/reference/url_path_append.html","id":null,"dir":"Reference","previous_headings":"","what":"Add path elements to a URL — url_path_append","title":"Add path elements to a URL — url_path_append","text":"Append zero path elements URL without duplicating \"/\" characters. Based httr2::req_url_path_append().","code":""},{"path":"https://nectar.api2r.org/reference/url_path_append.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add path elements to a URL — url_path_append","text":"","code":"url_path_append(url, ...)"},{"path":"https://nectar.api2r.org/reference/url_path_append.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add path elements to a URL — url_path_append","text":"url URL modify. ... Path elements append, strings.","code":""},{"path":"https://nectar.api2r.org/reference/url_path_append.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add path elements to a URL — url_path_append","text":"modified URL.","code":""},{"path":"https://nectar.api2r.org/reference/url_path_append.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add path elements to a URL — url_path_append","text":"","code":"url_path_append(\"https://example.com\", \"api\", \"v1\", \"users\") #> [1] \"https://example.com/api/v1/users\" url_path_append(\"https://example.com/\", \"/api\", \"/v1\", \"/users\") #> [1] \"https://example.com/api/v1/users\" url_path_append(\"https://example.com/\", \"/api/v1/users\") #> [1] \"https://example.com/api/v1/users\""}]
+[{"path":[]},{"path":"https://nectar.api2r.org/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://nectar.api2r.org/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://nectar.api2r.org/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://nectar.api2r.org/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://nectar.api2r.org/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement jonthegeek@gmail.com. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://nectar.api2r.org/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://nectar.api2r.org/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://nectar.api2r.org/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://nectar.api2r.org/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://nectar.api2r.org/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://nectar.api2r.org/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.1, available https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. Community Impact Guidelines inspired [Mozilla’s code conduct enforcement ladder][https://github.com/mozilla/inclusion]. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https://www.contributor-covenant.org/translations.","code":""},{"path":"https://nectar.api2r.org/CONTRIBUTING.html","id":null,"dir":"","previous_headings":"","what":"Contributing to nectar","title":"Contributing to nectar","text":"outlines propose change nectar.","code":""},{"path":"https://nectar.api2r.org/CONTRIBUTING.html","id":"fixing-typos","dir":"","previous_headings":"","what":"Fixing typos","title":"Contributing to nectar","text":"can fix typos, spelling mistakes, grammatical errors documentation directly using GitHub web interface, long changes made source file. generally means ’ll need edit roxygen2 comments .R, .Rd file. can find .R file generates .Rd reading comment first line.","code":""},{"path":"https://nectar.api2r.org/CONTRIBUTING.html","id":"bigger-changes","dir":"","previous_headings":"","what":"Bigger changes","title":"Contributing to nectar","text":"want make bigger change, ’s good idea first file issue make sure someone team agrees ’s needed. ’ve found bug, please file issue illustrates bug minimal reprex (also help write unit test, needed).","code":""},{"path":"https://nectar.api2r.org/CONTRIBUTING.html","id":"pull-request-process","dir":"","previous_headings":"Bigger changes","what":"Pull request process","title":"Contributing to nectar","text":"Fork package clone onto computer. haven’t done , recommend using usethis::create_from_github(\"jonthegeek/nectar\", fork = TRUE). Install development dependencies devtools::install_dev_deps(), make sure package passes R CMD check running devtools::check(). R CMD check doesn’t pass cleanly, ’s good idea ask help continuing. Create Git branch pull request (PR). recommend using usethis::pr_init(\"brief-description--change\"). Make changes, commit git, create PR running usethis::pr_push(), following prompts browser. title PR briefly describe change. body PR contain Fixes #issue-number. user-facing changes, add bullet top NEWS.md (.e. just first header). Follow style described https://style.tidyverse.org/news.html.","code":""},{"path":"https://nectar.api2r.org/CONTRIBUTING.html","id":"code-style","dir":"","previous_headings":"Bigger changes","what":"Code style","title":"Contributing to nectar","text":"New code follow tidyverse style guide. can use styler package apply styles, please don’t restyle code nothing PR. use roxygen2, Markdown syntax, documentation. use testthat unit tests. Contributions test cases included easier accept.","code":""},{"path":"https://nectar.api2r.org/CONTRIBUTING.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Contributing to nectar","text":"Please note nectar project released Contributor Code Conduct. contributing project agree abide terms.","code":""},{"path":"https://nectar.api2r.org/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2023 nectar authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://nectar.api2r.org/SUPPORT.html","id":null,"dir":"","previous_headings":"","what":"Getting help with nectar","title":"Getting help with nectar","text":"Thanks using nectar! filing issue, places explore pieces put together make process smooth possible.","code":""},{"path":"https://nectar.api2r.org/SUPPORT.html","id":"make-a-reprex","dir":"","previous_headings":"","what":"Make a reprex","title":"Getting help with nectar","text":"Start making minimal reproducible example using reprex package. haven’t heard used reprex , ’re treat! Seriously, reprex make R-question-asking endeavors easier (pretty insane ROI five ten minutes ’ll take learn ’s ). additional reprex pointers, check Get help! section tidyverse site.","code":""},{"path":"https://nectar.api2r.org/SUPPORT.html","id":"where-to-ask","dir":"","previous_headings":"","what":"Where to ask?","title":"Getting help with nectar","text":"Armed reprex, next step figure ask. ’s question: ’s best ask R4DS Online Learning Community Slack. options include Posit Community, StackOverflow. people answer questions. ’s bug: ’re right place, file issue. ’re sure: let community help figure ! problem bug feature request, can easily return report . opening new issue, sure search issues pull requests make sure bug hasn’t reported /already fixed development version. default, search pre-populated :issue :open. can edit qualifiers (e.g. :pr, :closed) needed. example, ’d simply remove :open search issues repo, open closed.","code":""},{"path":"https://nectar.api2r.org/SUPPORT.html","id":"what-happens-next","dir":"","previous_headings":"","what":"What happens next?","title":"Getting help with nectar","text":"’ll try look issue soon can, packages maintained volunteers. good reprex particularly important might weeks months initial report start working . can’t reproduce bug, can’t fix !","code":""},{"path":"https://nectar.api2r.org/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Jon Harmon. Author, maintainer, copyright holder. R Consortium. Funder.","code":""},{"path":"https://nectar.api2r.org/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Harmon J (2024). nectar: Framework Web API Packages. R package version 0.0.0.9002, https://github.com/jonthegeek/nectar, https://nectar.api2r.org.","code":"@Manual{, title = {nectar: A Framework for Web API Packages}, author = {Jon Harmon}, year = {2024}, note = {R package version 0.0.0.9002, https://github.com/jonthegeek/nectar}, url = {https://nectar.api2r.org}, }"},{"path":"https://nectar.api2r.org/index.html","id":"nectar-","dir":"","previous_headings":"","what":"A Framework for Web API Packages","title":"A Framework for Web API Packages","text":"opinionated framework use within api-wrapping R packages.","code":""},{"path":"https://nectar.api2r.org/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"A Framework for Web API Packages","text":"can install development version nectar GitHub :","code":"# install.packages(\"remotes\") remotes::install_github(\"jonthegeek/nectar\")"},{"path":"https://nectar.api2r.org/index.html","id":"usage","dir":"","previous_headings":"","what":"Usage","title":"A Framework for Web API Packages","text":"Add usage information examples .","code":""},{"path":"https://nectar.api2r.org/index.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"A Framework for Web API Packages","text":"Please note nectar project released Contributor Code Conduct. contributing project, agree abide terms.","code":""},{"path":"https://nectar.api2r.org/reference/call_api.html","id":null,"dir":"Reference","previous_headings":"","what":"Send a request to an API — call_api","title":"Send a request to an API — call_api","text":"function implements opinionated framework making API calls. intended used inside API client package. serves wrapper around req_ family functions, httr2::request(), well httr2::req_perform() httr2::req_perform_iterative(), , default, httr2::resp_body_json().","code":""},{"path":"https://nectar.api2r.org/reference/call_api.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Send a request to an API — call_api","text":"","code":"call_api( base_url, path = NULL, query = NULL, body = NULL, mime_type = NULL, method = NULL, security_fn = NULL, security_args = list(), response_parser = httr2::resp_body_json, response_parser_args = list(), next_req = NULL, max_reqs = Inf, max_tries_per_req = 3, user_agent = \"nectar (https://nectar.api2r.org)\" )"},{"path":"https://nectar.api2r.org/reference/call_api.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Send a request to an API — call_api","text":"base_url part url shared calls API. cases may family base URLs, need choose one. path route API endpoint. Optionally, list path plus variables glue::glue() path. query optional list parameters pass query portion request. body object use body request. component body path, pass fs::path() otherwise give class \"fs_path\" indicate path. mime_type character scalar indicating mime type files present body. APIs allow leave NULL guess. method method something GET POST, supply . Case ignored. security_fn function use authenticate request. default (NULL), authentication performed. security_args optional list arguments security_fn function. response_parser function parse server response (resp). Defaults httr2::resp_body_json(), since JSON responses common. Set NULL return raw response httr2::req_perform(). response_parser_args optional list arguments pass response_parser function (addition resp). next_req optional function takes previous response (resp) generate next request call httr2::req_perform_iterative(). function can usually generated using one iteration helpers described httr2::iterate_with_offset(). max_reqs maximum number separate requests perform. Passed max_reqs argument httr2::req_perform_iterative() next_req supplied. default 2 likely changed Inf validate function. max_tries_per_req maximum number times attempt individual request. Passed max_tries argument httr2::req_retry(). user_agent string identify request coming . polite set user agent identify package, \"MyPackage (https://mypackage.com)\".","code":""},{"path":"https://nectar.api2r.org/reference/call_api.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Send a request to an API — call_api","text":"response API, parsed response_parser.","code":""},{"path":"https://nectar.api2r.org/reference/compact_nested_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Discard empty elements — compact_nested_list","title":"Discard empty elements — compact_nested_list","text":"Discard empty elements nested lists.","code":""},{"path":"https://nectar.api2r.org/reference/compact_nested_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Discard empty elements — compact_nested_list","text":"","code":"compact_nested_list(lst)"},{"path":"https://nectar.api2r.org/reference/compact_nested_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Discard empty elements — compact_nested_list","text":"lst (nested) list filter.","code":""},{"path":"https://nectar.api2r.org/reference/compact_nested_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Discard empty elements — compact_nested_list","text":"list, minus empty elements branches.","code":""},{"path":"https://nectar.api2r.org/reference/compact_nested_list.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Discard empty elements — compact_nested_list","text":"","code":"x <- list( a = list( b = letters, c = NULL, d = 1:5 ), e = NULL, f = 1:3 ) compact_nested_list(x) #> $a #> $a$b #> [1] \"a\" \"b\" \"c\" \"d\" \"e\" \"f\" \"g\" \"h\" \"i\" \"j\" \"k\" \"l\" \"m\" \"n\" \"o\" \"p\" \"q\" \"r\" \"s\" #> [20] \"t\" \"u\" \"v\" \"w\" \"x\" \"y\" \"z\" #> #> $a$d #> [1] 1 2 3 4 5 #> #> #> $f #> [1] 1 2 3 #>"},{"path":"https://nectar.api2r.org/reference/do_if_defined.html","id":null,"dir":"Reference","previous_headings":"","what":"Use a provided function — do_if_defined","title":"Use a provided function — do_if_defined","text":"constructing API calls programmatically, may encounter situations upstream task indicate function apply. example, one endpoint might use special security function used endpoints. function exists make coding situations easier.","code":""},{"path":"https://nectar.api2r.org/reference/do_if_defined.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Use a provided function — do_if_defined","text":"","code":"do_if_defined(x, fn = NULL, ...)"},{"path":"https://nectar.api2r.org/reference/do_if_defined.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Use a provided function — do_if_defined","text":"x object potentially modify, httr2::request() object. fn function apply x. fn NULL, x returned unchanged. ... Additional arguments pass fn.","code":""},{"path":"https://nectar.api2r.org/reference/do_if_defined.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Use a provided function — do_if_defined","text":"object, potentially modified.","code":""},{"path":"https://nectar.api2r.org/reference/do_if_defined.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Use a provided function — do_if_defined","text":"","code":"build_api_req <- function(endpoint, security_fn = NULL, ...) { req <- httr2::request(\"https://example.com\") req <- httr2::req_url_path_append(req, endpoint) do_if_defined(req, security_fn, ...) } # Most endpoints of this API do not require authentication. unsecure_req <- build_api_req(\"unsecure_endpoint\") unsecure_req$headers #> list() # But one endpoint requires secure_req <- build_api_req( \"secure_endpoint\", httr2::req_auth_bearer_token, \"secret-token\" ) secure_req$headers$Authorization #> [1] \"Bearer secret-token\""},{"path":"https://nectar.api2r.org/reference/dot-compact_nested_list_impl.html","id":null,"dir":"Reference","previous_headings":"","what":"Discard empty elements — .compact_nested_list_impl","title":"Discard empty elements — .compact_nested_list_impl","text":"Discard empty elements","code":""},{"path":"https://nectar.api2r.org/reference/dot-compact_nested_list_impl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Discard empty elements — .compact_nested_list_impl","text":"","code":".compact_nested_list_impl(lst, depth = 1L)"},{"path":"https://nectar.api2r.org/reference/dot-compact_nested_list_impl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Discard empty elements — .compact_nested_list_impl","text":"lst (nested) list filter. depth current recursion depth.","code":""},{"path":"https://nectar.api2r.org/reference/dot-compact_nested_list_impl.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Discard empty elements — .compact_nested_list_impl","text":"list, minus empty elements branches.","code":""},{"path":"https://nectar.api2r.org/reference/dot-req_body_auto.html","id":null,"dir":"Reference","previous_headings":"","what":"Send data in request body — .req_body_auto","title":"Send data in request body — .req_body_auto","text":"Automatically choose httr2::req_body_json() httr2::req_body_multipart() based content body. currently experimental needs tested APIs.","code":""},{"path":"https://nectar.api2r.org/reference/dot-req_body_auto.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Send data in request body — .req_body_auto","text":"","code":".req_body_auto(req, body, mime_type = NULL)"},{"path":"https://nectar.api2r.org/reference/dot-req_body_auto.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Send data in request body — .req_body_auto","text":"req httr2::request() object. body object use body request. component body path, pass fs::path() otherwise give class \"fs_path\" indicate path. mime_type character scalar indicating mime type files present body. APIs allow leave NULL guess.","code":""},{"path":"https://nectar.api2r.org/reference/dot-req_body_auto.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Send data in request body — .req_body_auto","text":"modified HTTP request.","code":""},{"path":"https://nectar.api2r.org/reference/dot-security_api_key_cookie.html","id":null,"dir":"Reference","previous_headings":"","what":"Authenticate with an API key in a cookie — .security_api_key_cookie","title":"Authenticate with an API key in a cookie — .security_api_key_cookie","text":"Authenticate API key cookie","code":""},{"path":"https://nectar.api2r.org/reference/dot-security_api_key_cookie.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Authenticate with an API key in a cookie — .security_api_key_cookie","text":"","code":".security_api_key_cookie(req, ..., path)"},{"path":"https://nectar.api2r.org/reference/dot-security_api_key_cookie.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Authenticate with an API key in a cookie — .security_api_key_cookie","text":"req httr2::request() object. path path cookie.","code":""},{"path":"https://nectar.api2r.org/reference/dot-security_api_key_cookie.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Authenticate with an API key in a cookie — .security_api_key_cookie","text":"httr2::request() object.","code":""},{"path":"https://nectar.api2r.org/reference/dot-security_api_key_header.html","id":null,"dir":"Reference","previous_headings":"","what":"Authenticate with an API key in the header of the request — .security_api_key_header","title":"Authenticate with an API key in the header of the request — .security_api_key_header","text":"Authenticate API key header request","code":""},{"path":"https://nectar.api2r.org/reference/dot-security_api_key_header.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Authenticate with an API key in the header of the request — .security_api_key_header","text":"","code":".security_api_key_header(req, ..., parameter_name, api_key)"},{"path":"https://nectar.api2r.org/reference/dot-security_api_key_header.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Authenticate with an API key in the header of the request — .security_api_key_header","text":"req httr2::request() object. parameter_name name use API key. api_key API key use.","code":""},{"path":"https://nectar.api2r.org/reference/dot-security_api_key_header.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Authenticate with an API key in the header of the request — .security_api_key_header","text":"httr2::request() object.","code":""},{"path":"https://nectar.api2r.org/reference/dot-shared-parameters.html","id":null,"dir":"Reference","previous_headings":"","what":"Parameters used in multiple functions — .shared-parameters","title":"Parameters used in multiple functions — .shared-parameters","text":"Reused parameter definitions gathered easier editing.","code":""},{"path":"https://nectar.api2r.org/reference/dot-shared-parameters.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Parameters used in multiple functions — .shared-parameters","text":"base_url part url shared calls API. cases may family base URLs, need choose one. body object use body request. component body path, pass fs::path() otherwise give class \"fs_path\" indicate path. case case standard apply. possible values self-descriptive. Defaults \"snake_case\". depth current recursion depth. method method something GET POST, supply . Case ignored. mime_type character scalar indicating mime type files present body. APIs allow leave NULL guess. path route API endpoint. Optionally, list path plus variables glue::glue() path. query optional list parameters pass query portion request. req httr2::request() object. response_parser function parse server response (resp). Defaults httr2::resp_body_json(), since JSON responses common. Set NULL return raw response httr2::req_perform(). response_parser_args optional list arguments pass response_parser function (addition resp). security_fn function use authenticate request. default (NULL), authentication performed. security_args optional list arguments security_fn function. user_agent string identify request coming . polite set user agent identify package, \"MyPackage (https://mypackage.com)\". x object update.","code":""},{"path":"https://nectar.api2r.org/reference/dot-shared-request.html","id":null,"dir":"Reference","previous_headings":"","what":"Returns from request functions — .shared-request","title":"Returns from request functions — .shared-request","text":"Returns request functions","code":""},{"path":"https://nectar.api2r.org/reference/dot-shared-request.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Returns from request functions — .shared-request","text":"httr2::request() object.","code":""},{"path":"https://nectar.api2r.org/reference/nectar-package.html","id":null,"dir":"Reference","previous_headings":"","what":"nectar: A Framework for Web API Packages — nectar-package","title":"nectar: A Framework for Web API Packages — nectar-package","text":"opinionated framework use within api-wrapping R packages.","code":""},{"path":[]},{"path":"https://nectar.api2r.org/reference/nectar-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"nectar: A Framework for Web API Packages — nectar-package","text":"Maintainer: Jon Harmon jonthegeek@gmail.com (ORCID) [copyright holder] contributors: R Consortium [funder]","code":""},{"path":"https://nectar.api2r.org/reference/req_perform_opinionated.html","id":null,"dir":"Reference","previous_headings":"","what":"Perform a request with opinionated defaults — req_perform_opinionated","title":"Perform a request with opinionated defaults — req_perform_opinionated","text":"function ensures request httr2::req_retry() applied, performs request, using either httr2::req_perform_iterative() (next_req function supplied) httr2::req_perform() ().","code":""},{"path":"https://nectar.api2r.org/reference/req_perform_opinionated.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Perform a request with opinionated defaults — req_perform_opinionated","text":"","code":"req_perform_opinionated( req, ..., next_req = NULL, max_reqs = 2, max_tries_per_req = 3 )"},{"path":"https://nectar.api2r.org/reference/req_perform_opinionated.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Perform a request with opinionated defaults — req_perform_opinionated","text":"req httr2::request() object. ... dots future extensions must empty. next_req optional function takes previous response (resp) generate next request call httr2::req_perform_iterative(). function can usually generated using one iteration helpers described httr2::iterate_with_offset(). max_reqs maximum number separate requests perform. Passed max_reqs argument httr2::req_perform_iterative() next_req supplied. default 2 likely changed Inf validate function. max_tries_per_req maximum number times attempt individual request. Passed max_tries argument httr2::req_retry().","code":""},{"path":"https://nectar.api2r.org/reference/req_perform_opinionated.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Perform a request with opinionated defaults — req_perform_opinionated","text":"list httr2::response() objects, one request performed.","code":""},{"path":"https://nectar.api2r.org/reference/req_prepare.html","id":null,"dir":"Reference","previous_headings":"","what":"Prepare a request for an API — req_prepare","title":"Prepare a request for an API — req_prepare","text":"function implements opinionated framework preparing API request. intended used inside API client package. serves wrapper around req_ family functions, httr2::request().","code":""},{"path":"https://nectar.api2r.org/reference/req_prepare.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Prepare a request for an API — req_prepare","text":"","code":"req_prepare( base_url, ..., path = NULL, query = NULL, body = NULL, mime_type = NULL, method = NULL, user_agent = \"nectar (https://nectar.api2r.org)\" )"},{"path":"https://nectar.api2r.org/reference/req_prepare.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Prepare a request for an API — req_prepare","text":"base_url part url shared calls API. cases may family base URLs, need choose one. ... dots future extensions must empty. path route API endpoint. Optionally, list path plus variables glue::glue() path. query optional list parameters pass query portion request. body object use body request. component body path, pass fs::path() otherwise give class \"fs_path\" indicate path. mime_type character scalar indicating mime type files present body. APIs allow leave NULL guess. method method something GET POST, supply . Case ignored. user_agent string identify request coming . polite set user agent identify package, \"MyPackage (https://mypackage.com)\".","code":""},{"path":"https://nectar.api2r.org/reference/req_prepare.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Prepare a request for an API — req_prepare","text":"httr2::request() object.","code":""},{"path":"https://nectar.api2r.org/reference/resp_parse.html","id":null,"dir":"Reference","previous_headings":"","what":"Parse one or more responses — resp_parse","title":"Parse one or more responses — resp_parse","text":"httr2 provides two methods performing requests: httr2::req_perform(), returns single httr2::response() object, httr2::req_perform_iterative(), returns list httr2::response() objects. function automatically determines whether single response multiple responses returned, parses responses appropriately.","code":""},{"path":"https://nectar.api2r.org/reference/resp_parse.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Parse one or more responses — resp_parse","text":"","code":"resp_parse(resp, ...) # S3 method for default resp_parse( resp, ..., arg = rlang::caller_arg(resp), call = rlang::caller_env() ) # S3 method for httr2_response resp_parse(resp, ..., response_parser = httr2::resp_body_json)"},{"path":"https://nectar.api2r.org/reference/resp_parse.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Parse one or more responses — resp_parse","text":"resp single httr2::response() object (returned httr2::req_perform()) list objects (returned httr2::req_perform_iterative()). ... Additional arguments passed response_parser function (addition resp). arg argument name string. argument mentioned error messages input origin problem. call execution environment currently running function, e.g. caller_env(). function mentioned error messages source error. See call argument abort() information. response_parser function parse server response (resp). Defaults httr2::resp_body_json(), since JSON responses common. Set NULL return raw response httr2::req_perform().","code":""},{"path":"https://nectar.api2r.org/reference/resp_parse.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Parse one or more responses — resp_parse","text":"response parsed response_parser. resp list, parsed responses concatenated. See httr2::resps_data() examples.","code":""},{"path":"https://nectar.api2r.org/reference/security_api_key.html","id":null,"dir":"Reference","previous_headings":"","what":"Authenticate with an API key — security_api_key","title":"Authenticate with an API key — security_api_key","text":"Many APIs provide API keys can used authenticate requests (, often, provide information user). function helps apply keys requests.","code":""},{"path":"https://nectar.api2r.org/reference/security_api_key.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Authenticate with an API key — security_api_key","text":"","code":"security_api_key(req, ..., location = \"header\")"},{"path":"https://nectar.api2r.org/reference/security_api_key.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Authenticate with an API key — security_api_key","text":"req httr2::request() object. ... Additional parameters depending location API key. parameter_name (\"header\" \"query\" ) name parameter use header query. api_key (\"header\" \"query\" ) API key use. path (\"cookie\" ) location cookie. location API key passed. One \"header\" (default), \"query\", \"cookie\".","code":""},{"path":"https://nectar.api2r.org/reference/security_api_key.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Authenticate with an API key — security_api_key","text":"httr2::request() object.","code":""},{"path":"https://nectar.api2r.org/reference/stabilize_string.html","id":null,"dir":"Reference","previous_headings":"","what":"Ensure an argument is a length-1 character — stabilize_string","title":"Ensure an argument is a length-1 character — stabilize_string","text":"Calls APIs often require string argument. function ensures arguments length-1, non-NA character vectors, length-1, non-NA vectors can coerced character vectors. intended ensure calls API fail predictable errors, thus avoiding unnecessary internet traffic.","code":""},{"path":"https://nectar.api2r.org/reference/stabilize_string.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Ensure an argument is a length-1 character — stabilize_string","text":"","code":"stabilize_string( x, ..., regex = NULL, arg = rlang::caller_arg(x), call = rlang::caller_env() )"},{"path":"https://nectar.api2r.org/reference/stabilize_string.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Ensure an argument is a length-1 character — stabilize_string","text":"x argument stabilize. ... Arguments passed stbl::stabilize_chr_scalar x_class Character. class name x use error messages. Use remove special class x checking coercion, want error message match original class. regex Character scalar. optional regex pattern compare value(s) x . complex regex pattern throws error, try installing stringi package install.packages(\"stringi\"). arg argument name string. argument mentioned error messages input origin problem. call execution environment currently running function, e.g. caller_env(). function mentioned error messages source error. See call argument abort() information.","code":""},{"path":"https://nectar.api2r.org/reference/stabilize_string.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Ensure an argument is a length-1 character — stabilize_string","text":"x coerced length-1 character vector, possible.","code":""},{"path":"https://nectar.api2r.org/reference/stabilize_string.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Ensure an argument is a length-1 character — stabilize_string","text":"","code":"stabilize_string(\"a\") #> [1] \"a\" stabilize_string(1.1) #> [1] \"1.1\" x <- letters try(stabilize_string(x)) #> Error in eval(expr, envir, enclos) : #> `x` must be a single . #> ✖ `x` has 26 values. x <- NULL try(stabilize_string(x)) #> Error in eval(expr, envir, enclos) : #> `x` must not be . x <- character() try(stabilize_string(x)) #> Error in eval(expr, envir, enclos) : #> `x` must be a single . #> ✖ `x` has no values. x <- NA try(stabilize_string(x)) #> Error in eval(expr, envir, enclos) : #> `x` must not contain NA values. #> • NA locations: 1"},{"path":"https://nectar.api2r.org/reference/url_path_append.html","id":null,"dir":"Reference","previous_headings":"","what":"Add path elements to a URL — url_path_append","title":"Add path elements to a URL — url_path_append","text":"Append zero path elements URL without duplicating \"/\" characters. Based httr2::req_url_path_append().","code":""},{"path":"https://nectar.api2r.org/reference/url_path_append.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add path elements to a URL — url_path_append","text":"","code":"url_path_append(url, ...)"},{"path":"https://nectar.api2r.org/reference/url_path_append.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add path elements to a URL — url_path_append","text":"url URL modify. ... Path elements append, strings.","code":""},{"path":"https://nectar.api2r.org/reference/url_path_append.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add path elements to a URL — url_path_append","text":"modified URL.","code":""},{"path":"https://nectar.api2r.org/reference/url_path_append.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add path elements to a URL — url_path_append","text":"","code":"url_path_append(\"https://example.com\", \"api\", \"v1\", \"users\") #> [1] \"https://example.com/api/v1/users\" url_path_append(\"https://example.com/\", \"/api\", \"/v1\", \"/users\") #> [1] \"https://example.com/api/v1/users\" url_path_append(\"https://example.com/\", \"/api/v1/users\") #> [1] \"https://example.com/api/v1/users\""}]
diff --git a/sitemap.xml b/sitemap.xml
index 2db37b5..ceaaad0 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -30,6 +30,9 @@
https://nectar.api2r.org/reference/compact_nested_list.html
+
+ https://nectar.api2r.org/reference/do_if_defined.html
+
https://nectar.api2r.org/reference/dot-compact_nested_list_impl.html