Ce gestionnaire httpd_uri_t répond juste Hello World! :
esp32-minimal-httpd_uri_t-example-esp-idf.cpp
static const httpd_uri_t rootHandler = {
.uri = "/",
.method = HTTP_GET,
.handler = [](httpd_req_t *req) {
httpd_resp_set_type(req, "text/html");
httpd_resp_send(req, "<h1>Hello World!</h1>", HTTPD_RESP_USE_STRLEN);
return ESP_OK;
}
};
Consultez les articles similaires par catégorie :
C/C++ ESP8266/ESP32
Si cet article vous a aidé, pensez à m'offrir un café ou à faire un don via PayPal pour soutenir la recherche et la publication de nouveaux articles sur TechOverflow