seanmonstar / reqwest

An easy and powerful Rust HTTP Client
https://docs.rs/reqwest
Apache License 2.0
9.89k stars 1.12k forks source link

WASM support extended #2072

Open ssddOnTop opened 10 months ago

ssddOnTop commented 10 months ago

It is important to convert request/response to other type for caching. Can someone implement impl From for WASM (I saw the PR #1920 and want something similar like this)

About bounty: I am offering $50 with deadline of 30 Dec 12am IST(UTC +5:30) for the bounty claim. The bounty can be awarded via GH Sponsors(one-time)/Paypal/Upi.

NOTE: This bounty is not awarded by anyone from reqwest/seanmonster. This is solely offered by me and no one from reqwest is responsible for this bounty.

Edit: any alternative ways/suggestion for caching(with middleware) are welcome.

seanmonstar commented 10 months ago

Could you describe what exactly you're looking for? A vague request with a bounty could just incentivize pull requests that I cannot merge, which is more work on my part.

ssddOnTop commented 10 months ago

Our current implementation uses reqwest_middleware::ClientWithMiddleware with http_cache_reqwest to cache egress. But for wasm, reqwest::wasm::Response (and same with Request) can be converted to some type that can be cached but there is no way to convert that type back to reqwest::wasm::Response. I need some functionality just like impl From in async_impl::Response