Page 1 of 1

httpd_register_uri_handler, catch all un-registered requests

Posted: Tue Feb 12, 2019 2:40 pm
by mikemoy
In messing with esp_http_server.h, we must register each incoming request with httpd_register_uri_handler().
Is there a way to see if there was any other request coming in that was not registered ?

Re: httpd_register_uri_handler, catch all un-registered requests

Posted: Mon Feb 18, 2019 5:41 am
by ESP_Anurag
An easy way of handling various HTTP server errors will soon be available. So one can register an error handler for say 404 error, which is generated when requested URI is not found. Till this features is merged you could use the wildcard matching scheme to handle requests to all URIs "/*" other than the valid ones. Make sure to register the valid URIs first and then register handler for "/*"