pub struct Request<'a> { /* fields omitted */ }
Request is the entry point for all fetch requests. Its methods configure
the request, and and handle the response. Many of them return the original
struct, and are intended to be used chained together.
Add a single header. String multiple calls to this together to add multiple ones.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers
pub fn body(self, val: &JsValue) -> Self | [src] |
pub fn body_json<A: Serialize>(self, val: &A) -> Self | [src] |
Serialize a Rust data structure as JSON; eg the payload in a POST request.
https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials
https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity
https://developer.mozilla.org/en-US/docs/Web/API/Request/mode
https://developer.mozilla.org/en-US/docs/Web/HTTP/Redirections
https://developer.mozilla.org/en-US/docs/Web/API/Document/referrer
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy
Use this if you want access to the web_sys::Request, eg for status code.
https://developer.mozilla.org/en-US/docs/Web/API/Body/text
Use this to access the response's JSON:
https://developer.mozilla.org/en-US/docs/Web/API/Body/json
Formats the value using the given formatter. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Mutably borrows from an owned value. Read more