You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, thank you for your work in creating this project.
I am trying to inject a default HeaderMap in client builder. I saw that there is SetOpt implementation as well but no method in Configurable to append the headers.
How can I achieve something like this?
letmut headers = HeaderMap::new();
headers.insert("X-header-something",HeaderValue::from_str("my-value").unwrap(),);let c = isahc::HttpClientBuilder::new().set_default_headers(headers)// <---- Something like this.build()?;
The text was updated successfully, but these errors were encountered:
That's just used as an internal helper for setting the headers provided in a Request given. Implementing default headers for a client would leverage the same code path.
* Might fix#184
Signed-off-by: Ankur Srivastava <best.ankur@gmail.com>
* handle review
Signed-off-by: Ankur Srivastava <best.ankur@gmail.com>
* more test cases
Signed-off-by: Ankur Srivastava <best.ankur@gmail.com>
* trying to match with Any in tests
Signed-off-by: Ankur Srivastava <best.ankur@gmail.com>
* use keys to iterate over HeaderMap
Signed-off-by: Ankur Srivastava <best.ankur@gmail.com>
* removed DefaultHeaderMap implementation, not using .set_opt anymore
Signed-off-by: Ankur Srivastava <best.ankur@gmail.com>
* format
Signed-off-by: Ankur Srivastava <best.ankur@gmail.com>
* review comments:
- Keep the error as enum http::Error
- Commented out the failing tests until it gets fixed upstream in mockito
Signed-off-by: Ankur Srivastava <best.ankur@gmail.com>
Hi, thank you for your work in creating this project.
I am trying to inject a default
HeaderMap
in client builder. I saw that there isSetOpt
implementation as well but no method inConfigurable
to append the headers.How can I achieve something like this?
The text was updated successfully, but these errors were encountered: