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
[taken from #57]
There is currently no wrapper for reqwest::Response. As a result, resp.body().await? [...]
... returns a reqwest::Error instead of reqwest_middleware::Error.
Solution
It would be possible to create wrapper types but this is not really feasible.
Instead there should be a wrapper to make the api more uniform.
Additional context
I'm implementing reqwest-middleware for https://github.com/peanutbother/api-client to extend its features I'm trying to change to reqwest-middleware which introduces non uniform apis:
I might be missing something, if you change your return type to reqwest_middleware::Error, wouldn't it work with reqwest-middleware as-is? You'd need to change it anyways if we were to apply this suggestion here, no?
Motivations
... returns a
reqwest::Error
instead ofreqwest_middleware::Error
.Solution
It would be possible to create wrapper types but this is not really feasible.
Instead there should be a wrapper to make the api more uniform.
Additional context
I'm implementing reqwest-middleware for https://github.com/peanutbother/api-client to extend its features I'm trying to change to reqwest-middleware which introduces non uniform apis:
https://github.com/peanutbother/api-client/blob/main/src/lib.rs#L453
where
fails due to the response not being wrapped.
The text was updated successfully, but these errors were encountered: