-
-
Notifications
You must be signed in to change notification settings - Fork 38
Description
Currently the easy_hook function gets passed an info parameter with URL, method and headers:
Lines 341 to 342 in e22219f
| info = (url = url, method = method, headers = headers) | |
| easy_hook(downloader, easy, info) |
But I can't see how to use this to set options on a per-request basis as HTTP.jl currently allows for things like the connection timeout (https://curl.se/libcurl/c/CURLOPT_CONNECTTIMEOUT.html). Ideally we'd add connection timeouts and some other obviously useful parameters (will post a separate issue about those), but to cover more unforeseen settings it would be helpful if there was some way to get per-request items into the info struct.
I'm not sure what's best for the API. A couple of possible ideas:
- Add an
easy_hook_opts::Any=nothingkeyword torequest, and just pass this through in theinfotuple. - Add an
easy_hook::Union{Function,Nothing}=nothingkeyword torequestand invoke this on the easy handle (maybe in addition to the easy hook which is contained in theDownloader).
I kind of favor the second of these ideas. Perhaps not as a public part of the API, but as an escape hatch it sure would be handy.