pub struct Request { /* private fields */ }Implementations§
Source§impl Request
impl Request
pub fn new(client: Client, url: Arc<String>, method: HttpMethod) -> Self
pub fn body(self, content: String, content_type: &'static str) -> Self
Sourcepub fn headers(self, headers: Arc<Vec<(String, String)>>) -> Self
pub fn headers(self, headers: Arc<Vec<(String, String)>>) -> Self
Attach a list of custom HTTP headers.
These are applied after the auto-set Content-Type, so a user-supplied
Content-Type header will override the auto-set one.
pub fn read_response(self) -> Self
pub async fn execute(self) -> RequestResult
Auto Trait Implementations§
impl Freeze for Request
impl !RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnsafeUnpin for Request
impl !UnwindSafe for Request
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