if (rlang::is_installed(c("httr2", "sf")) && interactive()) {
base_url <- file.path(
"https://services.arcgis.com/P3ePLMYs2RVChkJx",
"arcgis", "rest", "services",
"ACS_Population_by_Race_and_Hispanic_Origin_Boundaries",
"FeatureServer", "2", "query",
fsep = "/"
)
# create the base request
req <- httr2::request(base_url)
# fill query parameters
req <- httr2::req_url_query(
req,
where = "1=1",
outFeilds = "objectid",
resultRecordCount = 1,
f = "pbf"
)
# make the request
resp <- httr2::req_perform(req)
# parse the request
resp_body_pbf(resp)
# simulate response from multi_req_perform
resps <- list(resp, resp, resp)
# process them all at once
resps_data_pbf(resps)
}
Run the code above in your browser using DataLab