pub struct HttpApi;Expand description
HttpApi
Stable HTTP API for canic users. Enforces metrics, limits, and IC-safe defaults.
Implementations§
Source§impl HttpApi
impl HttpApi
Sourcepub async fn get(
url: &str,
headers: &[(&str, &str)],
) -> Result<HttpRequestResult, Error>
pub async fn get( url: &str, headers: &[(&str, &str)], ) -> Result<HttpRequestResult, Error>
Perform a GET request and return the raw response.
Prefer get_with_label when URLs contain IDs or other high-cardinality path segments.
Sourcepub async fn get_with_label(
url: &str,
headers: &[(&str, &str)],
label: &str,
) -> Result<HttpRequestResult, Error>
pub async fn get_with_label( url: &str, headers: &[(&str, &str)], label: &str, ) -> Result<HttpRequestResult, Error>
Same as get, with an explicit metrics label.
Use stable low-cardinality labels such as provider or route names.
Sourcepub async fn get_raw(args: HttpRequestArgs) -> Result<HttpRequestResult, Error>
pub async fn get_raw(args: HttpRequestArgs) -> Result<HttpRequestResult, Error>
Perform a raw HTTP request with metrics, returning the response verbatim. Prefer workflow/ops label-aware helpers when exposing dynamic URLs.
Auto Trait Implementations§
impl Freeze for HttpApi
impl RefUnwindSafe for HttpApi
impl Send for HttpApi
impl Sync for HttpApi
impl Unpin for HttpApi
impl UnsafeUnpin for HttpApi
impl UnwindSafe for HttpApi
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