Page 1 of 1

ESP32 http server httpd_uri_match_wildcard

Posted: Fri Jan 25, 2019 8:50 am
by JSchaef
Hi,
I'm using ESP32 IDF and want to use the http server (started from demo) that is working.
Now when a set the wildcard

Code: Select all

config.uri_match_fn = httpd_uri_match_wildcard;
and register using

Code: Select all

httpd_register_uri_handler
the callback handler is called as desired.

But now in this handler I need to know the requested path in URL.
How is this be done?

Regards
Jorg

Re: ESP32 http server httpd_uri_match_wildcard

Posted: Fri Jan 25, 2019 11:02 am
by ESP_igrr
Request handler function receives a pointer to httpd_req_t structure, which has a 'uri' field: https://github.com/espressif/esp-idf/bl ... ver.h#L329

See the part of the example: https://github.com/espressif/esp-idf/bl ... #L224-L235

Re: ESP32 http server httpd_uri_match_wildcard

Posted: Fri Feb 01, 2019 8:09 am
by JSchaef
Hi ESP_igrr,
that's what I'm looking for - thank you.
Regards
Jorg