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
648 stars 214 forks source link

Hi, im not so understand for this part for httpd_app.c. Can i have more HTTP_GET from the custom_get_httpd_uri_handler custom_post #158

Closed Shakir555 closed 9 months ago

Shakir555 commented 10 months ago

/ function pointers to URI handlers that can be user made / esp_err_t (custom_get_httpd_uri_handler)(httpd_req_t r) = NULL; esp_err_t (custom_post_httpd_uri_handler)(httpd_req_t r) = NULL;

esp_err_t http_app_set_handler_hook( httpd_method_t method, esp_err_t (handler)(httpd_req_t r) ){

if(method == HTTP_GET){
    custom_get_httpd_uri_handler = handler;
    return ESP_OK;
}
else if(method == HTTP_POST){
    custom_post_httpd_uri_handler = handler;
    return ESP_OK;
}
else{
    return ESP_ERR_INVALID_ARG;
}

}