Add optional reqwest-middleware feature#1074
Conversation
Add a new `middleware` feature that allows users to opt into using `reqwest_middleware::Client` instead of `reqwest::Client`. This enables users to enable automatic retries or tracing in their application.
There was a problem hiding this comment.
The diff on this PR is unfortunately quite large due to duplication of each test output file with the middleware FF enabled.
|
This will be consumed by oxidecomputer/oxide.rs#1035 |
|
Do we want to update CI to run tests and/or builds with this feature enabled? |
|
Can you give me context on why we're doing this and where we intend to use it? Does this make sense as a cargo feature? Recall that features apply across the compilation so eg using this feature for one client crate would break the use of an unrelated client crate that did not intend to use the feature. |
This enables us to generate logs for API calls in
I think it's the least worst option:
|
|
A couple of options that seem potentially palatable
I don't see option 3 as viable. |
A settings option is much cleaner, thanks! I've opened #1079, will close this out. |
Add a new
middlewarefeature that allows users to opt into usingreqwest_middleware::Clientinstead ofreqwest::Client. This enables users to enable automatic retries or tracing in their application.