pub struct HttpClient { /* private fields */ }
Expand description
HTTP client with retry logic and progress reporting
Implementations§
Source§impl HttpClient
impl HttpClient
Sourcepub fn with_config(config: HttpConfig) -> Self
pub fn with_config(config: HttpConfig) -> Self
Create a new HTTP client with custom configuration
Sourcepub async fn post_json_with_retry<T>(
&self,
url: &str,
body: &T,
operation_name: &str,
) -> LangExtractResult<Value>where
T: Serialize,
pub async fn post_json_with_retry<T>(
&self,
url: &str,
body: &T,
operation_name: &str,
) -> LangExtractResult<Value>where
T: Serialize,
POST request with JSON body and retry logic
Sourcepub fn with_header(self, key: String, value: String) -> Self
pub fn with_header(self, key: String, value: String) -> Self
Add a header to all requests
Sourcepub fn with_auth_header(self, auth_type: &str, token: &str) -> Self
pub fn with_auth_header(self, auth_type: &str, token: &str) -> Self
Set authentication header
Sourcepub fn with_bearer_token(self, token: &str) -> Self
pub fn with_bearer_token(self, token: &str) -> Self
Set bearer token authentication
Sourcepub fn with_api_key(self, key: &str) -> Self
pub fn with_api_key(self, key: &str) -> Self
Set API key header
Source§impl HttpClient
Provider-specific HTTP client builders
impl HttpClient
Provider-specific HTTP client builders
Sourcepub fn for_openai(api_key: &str) -> Self
pub fn for_openai(api_key: &str) -> Self
Create HTTP client configured for OpenAI
Sourcepub fn for_ollama() -> Self
pub fn for_ollama() -> Self
Create HTTP client configured for Ollama
Sourcepub fn for_custom_provider(api_key: Option<&str>) -> Self
pub fn for_custom_provider(api_key: Option<&str>) -> Self
Create HTTP client for custom providers
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HttpClient
impl !RefUnwindSafe for HttpClient
impl Send for HttpClient
impl Sync for HttpClient
impl Unpin 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