pub trait HttpClient: Send + Sync {
// Required methods
fn get_json(
&self,
url: &str,
headers: &[(&str, String)],
) -> Result<Value, Box<dyn Error + Send + Sync>>;
fn post_json(
&self,
url: &str,
headers: &[(&str, String)],
body: &Value,
) -> Result<Value, Box<dyn Error + Send + Sync>>;
}Expand description
Minimal HTTP client interface for JSON POST/GET calls.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".