Function ambient_api_core::prelude::http::get

source ·
pub async fn get(
    url: impl AsRef<str>,
    headers: Option<HashMap<String, String>>
) -> Result<Vec<u8>, HttpError>
Available on crate feature server only.
Expand description

Sends an HTTP GET request to the given URL, and returns the response body.

Any errors in sending or receiving will be returned as an HttpError.

NOTE: This may be replaced with wasi-http support in the future, which will allow the use of native Rust libraries like reqwest.