pub struct WeChatHttpClient { /* private fields */ }
Expand description
HTTP client wrapper for WeChat API calls with automatic retry and token management.
Implementations§
Source§impl WeChatHttpClient
impl WeChatHttpClient
Sourcepub fn with_retry_config(retry_config: RetryConfig) -> Result<Self>
pub fn with_retry_config(retry_config: RetryConfig) -> Result<Self>
Creates a new client with custom retry configuration.
Sourcepub async fn get_with_token(
&self,
endpoint: &str,
access_token: &str,
) -> Result<Response>
pub async fn get_with_token( &self, endpoint: &str, access_token: &str, ) -> Result<Response>
Makes a GET request with access token.
Sourcepub async fn post_json_with_token<T: Serialize>(
&self,
endpoint: &str,
access_token: &str,
body: &T,
) -> Result<Response>
pub async fn post_json_with_token<T: Serialize>( &self, endpoint: &str, access_token: &str, body: &T, ) -> Result<Response>
Makes a POST request with JSON body and access token.
Sourcepub async fn upload_file(
&self,
endpoint: &str,
access_token: &str,
field_name: &str,
file_data: Vec<u8>,
filename: &str,
) -> Result<Response>
pub async fn upload_file( &self, endpoint: &str, access_token: &str, field_name: &str, file_data: Vec<u8>, filename: &str, ) -> Result<Response>
Uploads a file using multipart form data.
Trait Implementations§
Source§impl Clone for WeChatHttpClient
impl Clone for WeChatHttpClient
Source§fn clone(&self) -> WeChatHttpClient
fn clone(&self) -> WeChatHttpClient
Returns a duplicate 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 WeChatHttpClient
impl !RefUnwindSafe for WeChatHttpClient
impl Send for WeChatHttpClient
impl Sync for WeChatHttpClient
impl Unpin for WeChatHttpClient
impl !UnwindSafe for WeChatHttpClient
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