pub struct Http;Expand description
Http Approved, observable HTTP helpers over the IC management API.
Implementations§
Source§impl Http
impl Http
Sourcepub const MAX_RESPONSE_BYTES: u64 = 200_000u64
pub const MAX_RESPONSE_BYTES: u64 = 200_000u64
Maximum allowed response size for HTTP outcalls.
Sourcepub async fn get<T: DeserializeOwned>(
url: &str,
headers: impl AsRef<[(&str, &str)]>,
) -> Result<T, Error>
pub async fn get<T: DeserializeOwned>( url: &str, headers: impl AsRef<[(&str, &str)]>, ) -> Result<T, Error>
Perform an HTTP GET request and deserialize the JSON response.
Sourcepub async fn get_with_label<T: DeserializeOwned>(
url: &str,
headers: impl AsRef<[(&str, &str)]>,
label: Option<&str>,
) -> Result<T, Error>
pub async fn get_with_label<T: DeserializeOwned>( url: &str, headers: impl AsRef<[(&str, &str)]>, label: Option<&str>, ) -> Result<T, Error>
Same as get, with an optional metrics label.
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 IC response verbatim.
Sourcepub async fn get_raw_with_label(
args: HttpRequestArgs,
label: Option<&str>,
) -> Result<HttpRequestResult, Error>
pub async fn get_raw_with_label( args: HttpRequestArgs, label: Option<&str>, ) -> Result<HttpRequestResult, Error>
Same as get_raw, with an optional metrics label.
Auto Trait Implementations§
impl Freeze for Http
impl RefUnwindSafe for Http
impl Send for Http
impl Sync for Http
impl Unpin for Http
impl UnwindSafe for Http
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