tonyp7 / esp32-wifi-manager

Captive Portal for ESP32 that can connect to a saved wireless network or start an access point where you can connect to existing wifis.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Need Help! How to have multiple HTTP_GET for http_app_set_handler_hook

Shakir555 opened this issue · comments

Here my screenshot the problem facing.
Multiple Handler hook
handler_hook

here my code snippet

//Set Custom handler for OTA on the http_server
    http_app_set_handler_hook(HTTP_GET, &data_html_handler);
    http_app_set_handler_hook(HTTP_GET, &ota_html_handler);
    http_app_set_handler_hook(HTTP_POST, &ota_update_post_handler);
    http_app_set_handler_hook(HTTP_POST, &ota_update_status_handler);

I Mark this as closed as already solved the problem. What was happening is there should be only one HTTP_GET, &get_handler. get_handler(httpd_req_t *req) to have logic if...else if to have many pages. This how Wifimanager to operate multiple page.