Repository: seanmonstar/reqwest (language: rust)

Issue:
Unable to create request in wasm environment
Hey,

I'm using this with the `yew` project and trying to make a HTTP call. However, when I do:

```rust
let mut reqwest = Request::new(
    method,
    Url::from_str(&url)
        .context(format!("Unable to parse request url: {}", url))?,
);

*reqwest.headers_mut() = headers;
*reqwest.body_mut() = Some(body.into());
```

I get the following error:

```
error[E0624]: associated function `new` is private
   --> src/utils/api/mod.rs:163:29
    |
163 |     let mut reqwest = Request::new(
    |                                ^^^ private associated function

error: aborting due to previous error

For more information about this error, try `rustc --explain E0624`.
```

I feel like the new function is made private in wasm environments and kept public in linux environments. Any help on how to proceed would be appreciated


Discussion / hints:
Is that constructor normally public? If so, it may be just has been overlooked in wasm. Want to send a PR?

Fix patch:
diff --git a/src/wasm/request.rs b/src/wasm/request.rs
index b7c7990a7..c6828e1de 100644
--- a/src/wasm/request.rs
+++ b/src/wasm/request.rs
@@ -27,7 +27,9 @@ pub struct RequestBuilder {
 }
 
 impl Request {
-    pub(super) fn new(method: Method, url: Url) -> Self {
+    /// Constructs a new request.
+    #[inline]
+    pub fn new(method: Method, url: Url) -> Self {
         Request {
             method,
             url,


Test patch: