Skip to content

Unable to depend on ic-utils for http_request interface when targeting Wasm #201

@paulyoung

Description

@paulyoung

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions