Struct square_rust::http::client::http_client::SquareHttpClient
source · pub struct SquareHttpClient {
pub client: Client,
pub retry_client: ClientWithMiddleware,
}
Expand description
HTTP Client to send HTTP Requests and read the responses.
Fields§
§client: Client
The wrapped lib client
retry_client: ClientWithMiddleware
Implementations§
source§impl SquareHttpClient
impl SquareHttpClient
HTTP Client to send HTTP Requests and read the responses.
sourcepub fn try_new(config: &SquareHttpClientConfig) -> Result<Self, SquareApiError>
pub fn try_new(config: &SquareHttpClientConfig) -> Result<Self, SquareApiError>
Instantiates a new SquareHttpClient
given the provided SquareHttpClientConfig
.
sourcepub async fn post(
&self,
url: &str,
body: &str
) -> Result<Response, SquareApiError>
pub async fn post( &self, url: &str, body: &str ) -> Result<Response, SquareApiError>
Sends an HTTP POST
sourcepub async fn post_multipart(
&self,
url: &str,
body: &str,
filepath: &str
) -> Result<Response, SquareApiError>
pub async fn post_multipart( &self, url: &str, body: &str, filepath: &str ) -> Result<Response, SquareApiError>
Sends an HTTP POST with multipart form data
sourcepub async fn empty_post(&self, url: &str) -> Result<Response, SquareApiError>
pub async fn empty_post(&self, url: &str) -> Result<Response, SquareApiError>
Sends an HTTP POST without any body
sourcepub async fn put(
&self,
url: &str,
body: &str
) -> Result<Response, SquareApiError>
pub async fn put( &self, url: &str, body: &str ) -> Result<Response, SquareApiError>
Sends an HTTP PUT
sourcepub async fn put_multipart(
&self,
url: &str,
body: &str,
filepath: &str
) -> Result<Response, SquareApiError>
pub async fn put_multipart( &self, url: &str, body: &str, filepath: &str ) -> Result<Response, SquareApiError>
Sends an HTTP PUT with multipart form data
Trait Implementations§
source§impl Clone for SquareHttpClient
impl Clone for SquareHttpClient
source§fn clone(&self) -> SquareHttpClient
fn clone(&self) -> SquareHttpClient
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 !RefUnwindSafe for SquareHttpClient
impl Send for SquareHttpClient
impl Sync for SquareHttpClient
impl Unpin for SquareHttpClient
impl !UnwindSafe for SquareHttpClient
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