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.
MIT License
673 stars 220 forks source link

Need Help! How to have multiple HTTP_GET for http_app_set_handler_hook #157

Closed Shakir555 closed 1 year ago

Shakir555 commented 1 year ago

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);
Shakir555 commented 1 year ago

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.