Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to send async http request? #62

Closed
lz1998 opened this issue Nov 18, 2023 · 5 comments
Closed

How to send async http request? #62

lz1998 opened this issue Nov 18, 2023 · 5 comments

Comments

@lz1998
Copy link

lz1998 commented Nov 18, 2023

    let mut cli = embedded_svc::http::client::asynch::Client::wrap(
        esp_idf_svc::http::client::EspHttpConnection::new(
            &esp_idf_svc::http::client::Configuration::default(),
        )
        .unwrap(),
    );
    let result = cli.get("https://ifconfig.co/json").await;
    log::info!("{result:?}");
100 | pub struct EspHttpConnection {
    | ----------------------------
    | |
    | doesn't satisfy `_: Connection`
    | doesn't satisfy `_: Read`
    | doesn't satisfy `_: Write`
    |
@Vollbrecht
Copy link

sorry this is not a direct answer to your question, but if you are looking for one big async project where many of the presented stuff from here and from esp-idf-hal/svc is used have a look in this project

@lz1998
Copy link
Author

lz1998 commented Nov 18, 2023

sorry this is not a direct answer to your question, but if you are looking for one big async project where many of the presented stuff from here and from esp-idf-hal/svc is used have a look in this project

There isn't an async http client in ruwm.

Is it possible to get a TcpStream which implement embedded_svc::io::{asynch::Read, asynch::Write}. I am trying to send async http request.

@lz1998
Copy link
Author

lz1998 commented Nov 18, 2023

What should the param be in embedded_svc::http::client::asynch::Client::wrap(...)?

@Vollbrecht
Copy link

For one implementation of the client api see edge-net as ivmarkov pointed to. Though as per description need's some fixing

@ivmarkov
Copy link
Collaborator

Yes. Again: can you join the Matrix room? Issues are not supposed to serve as a Help forum.

@github-project-automation github-project-automation bot moved this from Todo to Done in esp-rs Nov 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants