Struct HttpClient
pub struct HttpClient { /* private fields */ }Expand description
HTTP client wrapping reqwest with retry and telemetry.
Implementations§
§impl HttpClient
impl HttpClient
pub fn new(config: HttpConfig) -> HttpClient
pub fn new(config: HttpConfig) -> HttpClient
Create a new HTTP client with the given configuration.
pub async fn post_json(
&self,
url: &str,
auth_headers: Vec<(String, String)>,
body: &impl Serialize,
) -> Result<Value, HttpError>
pub async fn post_json( &self, url: &str, auth_headers: Vec<(String, String)>, body: &impl Serialize, ) -> Result<Value, HttpError>
POST JSON to a URL and return the parsed response.
pub async fn patch_json(
&self,
url: &str,
auth_headers: Vec<(String, String)>,
body: &impl Serialize,
) -> Result<Value, HttpError>
pub async fn patch_json( &self, url: &str, auth_headers: Vec<(String, String)>, body: &impl Serialize, ) -> Result<Value, HttpError>
PATCH JSON to a URL and return the parsed response.
pub async fn put_json(
&self,
url: &str,
auth_headers: Vec<(String, String)>,
body: &impl Serialize,
) -> Result<Value, HttpError>
pub async fn put_json( &self, url: &str, auth_headers: Vec<(String, String)>, body: &impl Serialize, ) -> Result<Value, HttpError>
PUT JSON to a URL and return the parsed response.
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