Open cole-brokamp opened 7 months ago
There's nothing equivalent, but maybe there should be, just for proxies.
Thanks for confirming! I'll stick with httr for this purpose for now.
How would you see this being implemented here? I would love to help if possible.
I don't know yet; I need to think about it.
Hello, I am glad this issue already exists. I would like to second the motion to add something similar to httr::set_config
. I use it a lot in scripts where I work with API wrappers based on httr
. However, now I am set to work with a R package API wrapper based on httr2
which at the moment does not provide support to add options to the underlying HTTP request through its API, making it necessary to have some way to globally set the configuration.
And in addition to that: Thank you so, so much for all your amazing work here, Hadley!
Out of interest, what sort of options are you looking to set?
In order to configure my proxy settings I need the following:
It works totally fine used in req_options
or req_proxy
, however using the package (restatis in my case) I cannot pass these on to the httr2
pipeline used in a non-exported function (we might add support for that later but it would be great if there was a way to globally set the above settings).
Thanks! Definitely something I plan to add when I'm next working on httr2.
Would also be useful if you want to set up caching.
https://httr2.r-lib.org/reference/index.html
Is there an equivalent way to set global configurations that will be used by all requests?
I'm specifically looking for a way for an R user to set a proxy configuration that would apply to all requests made in an R session.