この httpd_uri_t ハンドラーは単に 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;
}
};
同じカテゴリの類似記事をチェック:
C/C++ ESP8266/ESP32
この記事が役に立った場合は、TechOverflow での新しい記事の調査と公開を支援するため、「Buy Me a Coffee」でのご支援、または PayPal 経由でのご寄付をご検討ください