Skip to content

wasm http-request doesn't return #48

@wgtun

Description

@wgtun

Hello, I would like to ask a question, I added a http request code, the mobile is normal, but the web does not return, I want to know where is my problem, web http request code like this:

use gloo_net::http::{Headers, Request};
#[tokio::main(flavor = "current_thread")]
pub fn request(params: MyRequest) -> Result<String> {
            let headers = get_web_default_headers().unwrap();
            for header in &params.headers {
                headers.set(&header.key, &header.value);
            }
            let result = Request::get(&params.url).headers(headers).send().await?;
            Ok(result.text().await?)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions