Skip to contents

Create a reusable tidy policy that applies resp_body_auto().

Usage

tidy_policy_body_auto()

Value

A list with class "nectar_tidy_policy" and elements tidy_fn and tidy_args.

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"