I added ic-utils = "0.3.1" to the [dependencies] section of my Cargo.toml file so I could do the following:
use ic_cdk_macros::{query};
use ic_utils::interfaces::http_request::{HttpResponse, HttpRequest};
#[query]
fn http_request(request: HttpRequest) -> HttpResponse {
...
}
However, that caused cargo build --target wasm32-unknown-unknown --package <my package> --release to fail.
ic-utils appears to transitively depend on openssl-sys, and apparently the openssl crate doesn't have support for WebAssembly.
I'll probably copy and paste what I need from http_request.rs for now but it would be great if we could depend on a crate from this repo that includes them instead.
I added
ic-utils = "0.3.1"to the[dependencies]section of myCargo.tomlfile so I could do the following:However, that caused
cargo build --target wasm32-unknown-unknown --package <my package> --releaseto fail.ic-utilsappears to transitively depend onopenssl-sys, and apparently theopensslcrate doesn't have support for WebAssembly.I'll probably copy and paste what I need from
http_request.rsfor now but it would be great if we could depend on a crate from this repo that includes them instead.