esp32 http server : how to get a wildcard in the uri ?
Posted: Mon Apr 22, 2019 10:22 am
Hi,
I can use the api to register specific URIs, but I can't find out how to use a wildcard.
None of what I tried (see below) works, I always get
Danny
I can use the api to register specific URIs, but I can't find out how to use a wildcard.
None of what I tried (see below) works, I always get
with messages like these in debug :
Thanks,W (9477) httpd_uri: httpd_uri: URI '/hello/this-tests-it' not found
W (9477) httpd_txrx: httpd_resp_send_err: 404 Not Found - This URI doesn't exist
Danny
Code: Select all
ESP_LOGI(webserver_tag, "Register URI handlers");
httpd_uri_t u_hello = {
"/hello", // URI handled
HTTP_GET, // HTTP method
hello_get_handler, // Handler
(void *)0 // User context
};
httpd_register_uri_handler(server, &u_hello);
u_hello.uri = "/hello/*";
httpd_register_uri_handler(server, &u_hello);
u_hello.uri = "/hello/%";
httpd_register_uri_handler(server, &u_hello);
u_hello.uri = "/index.html";