Skip to content

EspHttpServer.handle_get not found #126

@IricBing

Description

@IricBing

2022-12-13_17-31

EspHttpServer.handle_get methods not found at EspHttpServer struct when i test http server demo.

build error:

   Compiling http-server v0.1.0 (/home/iric/code/learn/espressif-trainings/intro/http-server)
error: could not compile `http-server` due to 3 previous errors; 2 warnings emitted
warning: unused imports: `io::Write`, `registry::Registry`
  --> examples/http_server.rs:10:20
   |
10 |     http::server::{registry::Registry, Response},
   |                    ^^^^^^^^^^^^^^^^^^
11 |     io::Write,
   |     ^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

error[E0599]: no method named `handle_get` found for struct `EspHttpServer` in the current scope
  --> examples/http_server.rs:31:12
   |
31 |     server.handle_get("/", |_request, response| {
   |            ^^^^^^^^^^ method not found in `EspHttpServer`

error[E0599]: no method named `handle_get` found for struct `EspHttpServer` in the current scope
  --> examples/http_server.rs:41:12
   |
41 |     server.handle_get("/temperature", move |_request, response| {
   |            ^^^^^^^^^^ method not found in `EspHttpServer`

warning: unused import: `Response`
  --> examples/http_server.rs:10:40
   |
10 |     http::server::{registry::Registry, Response},
   |                                        ^^^^^^^^

error: aborting due to 2 previous errors; 2 warnings emitted

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