pub struct HttpClient { /* private fields */ }Expand description
HTTP client for Sage agents.
Created via HttpClient::from_env() and used by generated code.
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 the given configuration.
Sourcepub async fn get(&self, url: String) -> SageResult<HttpResponse>
pub async fn get(&self, url: String) -> SageResult<HttpResponse>
Sourcepub async fn post(&self, url: String, body: String) -> SageResult<HttpResponse>
pub async fn post(&self, url: String, body: String) -> SageResult<HttpResponse>
Sourcepub async fn put(&self, url: String, body: String) -> SageResult<HttpResponse>
pub async fn put(&self, url: String, body: String) -> SageResult<HttpResponse>
Sourcepub async fn delete(&self, url: String) -> SageResult<HttpResponse>
pub async fn delete(&self, url: String) -> SageResult<HttpResponse>
Trait Implementations§
Source§impl Clone for HttpClient
impl Clone for HttpClient
Source§fn clone(&self) -> HttpClient
fn clone(&self) -> HttpClient
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 moreSource§impl Debug for HttpClient
impl Debug for HttpClient
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