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
When I execute cargo check --target wasm32-unknown-unknown, I get the following error:
Checking request-user-agent-wasm v0.1.0 (/tmp/request-user-agent-wasm)
error[E0599]: no method named `user_agent` found for struct `ClientBuilder` in the current scope
--> src/lib.rs:5:10
|
4 | let client = ClientBuilder::default()
| __________________-
5 | | .user_agent("FooBar/1.2.3")
| | -^^^^^^^^^^ method not found in `ClientBuilder`
| |_________|
|
For more information about this error, try `rustc --explain E0599`.
error: could not compile `request-user-agent-wasm` (lib) due to previous error
What I'm expecting
I would like that reqwest::wasm::ClientBuilder provide the method user_agent(..) to set the User-Agent header
Current workaround
reqwest::wasm::ClientBuilder provide default_headers(..) so I can use it to set User-Agent
Currently
reqwest
provide the methodClientBuilder::user_agent(..)
to set theUser-Agent
header.But this method does not exist when targeting
wasm32-unknown-unknown
.Steps to reproduce
I've the following
src/lib.rs
:and the following
Cargo.toml
:When I execute
cargo check --target wasm32-unknown-unknown
, I get the following error:What I'm expecting
I would like that
reqwest::wasm::ClientBuilder
provide the methoduser_agent(..)
to set theUser-Agent
headerCurrent workaround
reqwest::wasm::ClientBuilder
providedefault_headers(..)
so I can use it to setUser-Agent
The text was updated successfully, but these errors were encountered: