pub struct RequestBuilder<'a> { /* private fields */ }Expand description
Builder for a single HTTP request.
Implementations§
Source§impl<'a> RequestBuilder<'a>
impl<'a> RequestBuilder<'a>
Sourcepub fn body_text(self, s: &str) -> Self
pub fn body_text(self, s: &str) -> Self
Set a plain-text body (also sets Content-Type: text/plain).
Sourcepub fn body_json(self, s: &str) -> Self
pub fn body_json(self, s: &str) -> Self
Set a JSON body (also sets Content-Type: application/json).
Sourcepub fn timeout_ms(self, ms: u64) -> Self
pub fn timeout_ms(self, ms: u64) -> Self
Override the timeout for this request.
Sourcepub fn send(self) -> Result<Response, HttpClientError>
pub fn send(self) -> Result<Response, HttpClientError>
Send the request and return the response.
Automatically follows redirects up to the client’s max_redirects
limit.
Auto Trait Implementations§
impl<'a> Freeze for RequestBuilder<'a>
impl<'a> RefUnwindSafe for RequestBuilder<'a>
impl<'a> Send for RequestBuilder<'a>
impl<'a> Sync for RequestBuilder<'a>
impl<'a> Unpin for RequestBuilder<'a>
impl<'a> UnsafeUnpin for RequestBuilder<'a>
impl<'a> UnwindSafe for RequestBuilder<'a>
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