pub struct HttpSyncClient { /* private fields */ }
Implementations§
Source§impl HttpSyncClient
impl HttpSyncClient
pub fn new(config: &HttpClientConfig) -> Self
Sourcepub fn send(&mut self, req: &HttpRequest) -> Result<HttpResponse, Error>
pub fn send(&mut self, req: &HttpRequest) -> Result<HttpResponse, Error>
Send HTTP request, and return response
Sourcepub fn download(
&mut self,
url: &str,
dest_file: &str,
) -> Result<HttpResponse, Error>
pub fn download( &mut self, url: &str, dest_file: &str, ) -> Result<HttpResponse, Error>
Download a file
Sourcepub fn post(
&mut self,
url: &str,
body: &HttpBody,
) -> Result<HttpResponse, Error>
pub fn post( &mut self, url: &str, body: &HttpBody, ) -> Result<HttpResponse, Error>
Send POST request
pub fn connect( &self, uri: &Url, port: &u16, message: &Vec<u8>, ) -> Result<Box<dyn BufRead>, Error>
Trait Implementations§
Source§impl Clone for HttpSyncClient
impl Clone for HttpSyncClient
Source§fn clone(&self) -> HttpSyncClient
fn clone(&self) -> HttpSyncClient
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 HttpSyncClient
impl !RefUnwindSafe for HttpSyncClient
impl Send for HttpSyncClient
impl Sync for HttpSyncClient
impl Unpin for HttpSyncClient
impl !UnwindSafe for HttpSyncClient
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