pub struct HttpRequestBuilder { /* private fields */ }
Expand description
Builder for HttpRequest
.
Implementations§
Source§impl HttpRequestBuilder
impl HttpRequestBuilder
pub fn header( &mut self, name: impl Into<String>, value: impl Into<String>, ) -> &mut Self
Sourcepub fn json(&mut self, body: impl Serialize) -> &mut Self
pub fn json(&mut self, body: impl Serialize) -> &mut Self
Sets the body of the request to the JSON representation of the given value.
§Panics
Panics if the serialization fails.
Sourcepub fn build(&self) -> HttpRequest
pub fn build(&self) -> HttpRequest
Trait Implementations§
Source§impl Clone for HttpRequestBuilder
impl Clone for HttpRequestBuilder
Source§fn clone(&self) -> HttpRequestBuilder
fn clone(&self) -> HttpRequestBuilder
Returns a copy 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 moreAuto Trait Implementations§
impl Freeze for HttpRequestBuilder
impl RefUnwindSafe for HttpRequestBuilder
impl Send for HttpRequestBuilder
impl Sync for HttpRequestBuilder
impl Unpin for HttpRequestBuilder
impl UnwindSafe for HttpRequestBuilder
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