pub struct FetchOptions {
pub method: String,
pub headers: HashMap<String, String>,
pub body: Option<String>,
}Expand description
Optional knobs for fetch. All fields have sensible defaults - leave
them empty for a plain GET.
Fields§
§method: StringHTTP method. Empty string is treated as "GET" by the host.
headers: HashMap<String, String>Request headers. Header names are case-insensitive at the wire level.
body: Option<String>Request body as a UTF-8 string. For binary bodies, base64-encode the
bytes and set the appropriate content-encoding header.
Implementations§
Source§impl FetchOptions
impl FetchOptions
Trait Implementations§
Source§impl Clone for FetchOptions
impl Clone for FetchOptions
Source§fn clone(&self) -> FetchOptions
fn clone(&self) -> FetchOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FetchOptions
impl Debug for FetchOptions
Source§impl Default for FetchOptions
impl Default for FetchOptions
Source§fn default() -> FetchOptions
fn default() -> FetchOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FetchOptions
impl RefUnwindSafe for FetchOptions
impl Send for FetchOptions
impl Sync for FetchOptions
impl Unpin for FetchOptions
impl UnsafeUnpin for FetchOptions
impl UnwindSafe for FetchOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more