Create a reusable tidy policy that applies resp_body_auto().
See also
Other opinionated response parsers:
req_tidy_policy(),
resp_tidy(),
resp_tidy_json(),
resp_tidy_unknown(),
tidy_policy_json(),
tidy_policy_prepare(),
tidy_policy_unknown()
Examples
tidy_policy_body_auto()
#> $tidy_fn
#> function (resp)
#> {
#> content_type <- httr2::resp_content_type(resp)
#> switch(content_type, `application/json` = httr2::resp_body_json(resp),
#> `application/xml` = httr2::resp_body_xml(resp), `text/xml` = httr2::resp_body_xml(resp),
#> `application/xhtml+xml` = httr2::resp_body_html(resp),
#> `text/html` = httr2::resp_body_html(resp), `text/csv` = resp_body_csv(resp),
#> `text/tab-separated-values` = resp_body_tsv(resp), `image/svg+xml` = httr2::resp_body_string(resp),
#> .resp_body_auto_other(resp))
#> }
#> <bytecode: 0x55d53fce2fe0>
#> <environment: namespace:nectar>
#>
#> $tidy_args
#> list()
#>
#> attr(,"class")
#> [1] "nectar_tidy_policy"