pub struct HttpClient { /* private fields */ }Expand description
HTTP client with retry logic, rate limiting, and error handling.
Implementations§
Source§impl HttpClient
impl HttpClient
Sourcepub fn new(
timeout: Duration,
retry_config: RetryConfig,
rate_limiter: Option<Arc<RateLimiter>>,
base_url: Option<&str>,
user_agent: Option<&str>,
) -> Result<Self>
pub fn new( timeout: Duration, retry_config: RetryConfig, rate_limiter: Option<Arc<RateLimiter>>, base_url: Option<&str>, user_agent: Option<&str>, ) -> Result<Self>
Create a new HTTP client.
Sourcepub async fn do_request(
&self,
opts: &RequestOptions,
access_token: &str,
) -> Result<Response>
pub async fn do_request( &self, opts: &RequestOptions, access_token: &str, ) -> Result<Response>
Execute an HTTP request with retry logic and rate-limit awareness.
Sourcepub async fn get(
&self,
path: &str,
query_params: HashMap<String, String>,
access_token: &str,
) -> Result<Response>
pub async fn get( &self, path: &str, query_params: HashMap<String, String>, access_token: &str, ) -> Result<Response>
Convenience: GET request.
Auto Trait Implementations§
impl Freeze for HttpClient
impl !RefUnwindSafe for HttpClient
impl Send for HttpClient
impl Sync for HttpClient
impl Unpin for HttpClient
impl UnsafeUnpin for HttpClient
impl !UnwindSafe for HttpClient
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