pub struct CallRequest<'a> { /* private fields */ }
Expand description
present a http request
Implementations§
Source§impl<'a> CallRequest<'a>
impl<'a> CallRequest<'a>
Sourcepub fn with_header(self, key: &str, value: &str) -> GGRResult<CallRequest<'a>>
pub fn with_header(self, key: &str, value: &str) -> GGRResult<CallRequest<'a>>
adds a specific header to the request
Sourcepub fn with_json_body<S: Serialize>(
&mut self,
body: &S,
) -> GGRResult<&mut CallRequest<'a>>
pub fn with_json_body<S: Serialize>( &mut self, body: &S, ) -> GGRResult<&mut CallRequest<'a>>
sets the JSON request body for the request.
Sourcepub fn with_form_data(&mut self, form: Form) -> GGRResult<&mut CallRequest<'a>>
pub fn with_form_data(&mut self, form: Form) -> GGRResult<&mut CallRequest<'a>>
attaches some form data to the request.
Sourcepub fn follow_location(&mut self, val: bool) -> GGRResult<&mut CallRequest<'a>>
pub fn follow_location(&mut self, val: bool) -> GGRResult<&mut CallRequest<'a>>
enables or disables redirects. The default is off.
Sourcepub fn send_into<W: Write>(self, out: &mut W) -> GGRResult<CallResponse>
pub fn send_into<W: Write>(self, out: &mut W) -> GGRResult<CallResponse>
Sends the request and writes response data into the given file instead of the response object’s in memory buffer.
Sourcepub fn send(self) -> GGRResult<CallResponse>
pub fn send(self) -> GGRResult<CallResponse>
Sends the request and reads the response body into the response object.
Auto Trait Implementations§
impl<'a> Freeze for CallRequest<'a>
impl<'a> !RefUnwindSafe for CallRequest<'a>
impl<'a> !Send for CallRequest<'a>
impl<'a> !Sync for CallRequest<'a>
impl<'a> Unpin for CallRequest<'a>
impl<'a> !UnwindSafe for CallRequest<'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