https://github.com/ctron/reqwest-wasm-ext
Extension for reqwest on wasm targets
https://github.com/ctron/reqwest-wasm-ext
Last synced: over 1 year ago
JSON representation
Extension for reqwest on wasm targets
- Host: GitHub
- URL: https://github.com/ctron/reqwest-wasm-ext
- Owner: ctron
- Created: 2022-04-11T11:03:38.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-11T11:23:25.000Z (about 4 years ago)
- Last Synced: 2025-01-04T23:25:40.481Z (over 1 year ago)
- Language: Rust
- Size: 2.93 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# reqwest-wasm-ext
[](https://crates.io/crates/reqwest-wasm-ext)
[](https://docs.rs/reqwest-wasm-ext)
[](https://github.com/ctron/reqwest-wasm-ext/actions?query=workflow%3A%22CI%22)
This crate works around [seanmonstar/reqwest#1095](https://github.com/seanmonstar/reqwest/issues/1095).
Once [seanmonstar/reqwest#1096](https://github.com/seanmonstar/reqwest/pull/1096) is finally merged, this crate
should become obsolete.
## Example
Using the trait:
```rust
use reqwest::Client;
use reqwest_wasm_ext::RequestExt;
async fn do_request() {
let client = Client::new();
let req = client.get("http://localhost")
.basic_auth_ext("foo", Some("bar"));
}
```
Using the drop-in replacement function:
```rust
use reqwest::Client;
#[cfg(target_arch = "wasm32")]
use reqwest_wasm_ext::RequestExt;
async fn do_request() {
let client = Client::new();
let req = client.get("http://localhost")
.basic_auth("foo", Some("bar"));
}
```