pub trait HttpClient: Send + Sync {
// Required methods
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<HttpResponse, SteamError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_with_query<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
url: &'life1 str,
query: &'life2 [(&'life3 str, &'life4 str)],
) -> Pin<Box<dyn Future<Output = Result<HttpResponse, SteamError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait;
fn post<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
url: &'life1 str,
body: Vec<u8>,
content_type: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<HttpResponse, SteamError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn post_form<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
url: &'life1 str,
form: &'life2 [(&'life3 str, &'life4 str)],
) -> Pin<Box<dyn Future<Output = Result<HttpResponse, SteamError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait;
// Provided methods
fn get_with_cookies<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
url: &'life1 str,
cookies: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<HttpResponse, SteamError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn post_form_with_cookies<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
url: &'life1 str,
form: &'life2 [(&'life3 str, &'life4 str)],
cookies: &'life5 str,
) -> Pin<Box<dyn Future<Output = Result<HttpResponse, SteamError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait { ... }
}Expand description
HTTP client trait for making web requests.
This trait abstracts HTTP operations, enabling mock implementations for unit testing without actual network calls.
Required Methods§
Sourcefn get<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<HttpResponse, SteamError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<HttpResponse, SteamError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn get_with_query<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
url: &'life1 str,
query: &'life2 [(&'life3 str, &'life4 str)],
) -> Pin<Box<dyn Future<Output = Result<HttpResponse, SteamError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn get_with_query<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
url: &'life1 str,
query: &'life2 [(&'life3 str, &'life4 str)],
) -> Pin<Box<dyn Future<Output = Result<HttpResponse, SteamError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Perform a GET request with query parameters.
§Arguments
url- The base URLquery- Query parameters as key-value pairs
Sourcefn post<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
url: &'life1 str,
body: Vec<u8>,
content_type: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<HttpResponse, SteamError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn post<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
url: &'life1 str,
body: Vec<u8>,
content_type: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<HttpResponse, SteamError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Perform a POST request with a body.
§Arguments
url- The URL to post tobody- The request bodycontent_type- The content type header value
Sourcefn post_form<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
url: &'life1 str,
form: &'life2 [(&'life3 str, &'life4 str)],
) -> Pin<Box<dyn Future<Output = Result<HttpResponse, SteamError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn post_form<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
url: &'life1 str,
form: &'life2 [(&'life3 str, &'life4 str)],
) -> Pin<Box<dyn Future<Output = Result<HttpResponse, SteamError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Perform a POST request with form data.
§Arguments
url- The URL to post toform- Form fields as key-value pairs
Provided Methods§
Perform a GET request carrying a raw Cookie header value.
Default implementation delegates to get(url) and ignores cookies, so
existing mock/test implementations keep compiling. Real HTTP clients
should override this to attach the cookie header.
§Arguments
url- The URL to requestcookies- RawCookieheader value (e.g."sessionid=...; steamLoginSecure=...")
Perform a POST form request carrying a raw Cookie header value.
Default implementation delegates to post_form(url, form) and ignores
cookies, so existing mock/test implementations keep compiling. Real HTTP
clients should override this to attach the cookie header.