geomarker-io / appc

Daily, high resolution, near real-time, model-based ambient air pollution exposure assessments in R
http://geomarker.io/appc/
Other
0 stars 0 forks source link

how to set global proxy settings in httr2 #26

Closed cole-brokamp closed 9 months ago

cole-brokamp commented 9 months ago

httr::set_config could be used, but how will end user specify proxy that httr2 will know about in each download function?

cole-brokamp commented 9 months ago

it was

    ## httr2::req_proxy("http://bmiproxyp.chmcres.cchmc.org",
    ##   port = 80,
    ##   username = Sys.getenv("CCHMC_USERNAME"),
    ##   password = Sys.getenv("CCHMC_PASSWORD")
    ## ) |>
cole-brokamp commented 9 months ago

https://httr2.r-lib.org/reference/req_cache.html?q=cache#null

cole-brokamp commented 9 months ago

httr2::req_options() but this does not apply to all requests

have user defined req object to be added to each httr2 req within function?

cole-brokamp commented 9 months ago

should all download happen in one wrapper function around httr2 code?

cole-brokamp commented 9 months ago

download.file used in all cases except for merra data that uses basic authorization

environment variables for http_proxy can be used for underlying curl calls

package sets options to use libcurl but user could change this if there ever is a problem