Closed CreepySkeleton closed 4 years ago
This sounds like a good idea. I'm guessing we can use the #[serde(with = "...")]
trick to parse a Table
into a list of regex patterns and headers and from there we may need to pull request generation out into its own function instead of using the Client::get()
helper so patterns can be applied.
It should also easy to extend to interpolate environment variables for non-public endpoints (e.g. with an Authorization: Basic $GITHUB_TOKEN
) if people were interested.
Some websites (for example crates.io) require certain HTTP headers (for example
Accept
) to be passed in order to process the request properly.I propose to allow user to specify the needed headers for URLs matching a certain regexp: