ESP32 http server httpd_uri_match_wildcard

JSchaef
Posts: 13
Joined: Fri Jan 25, 2019 8:39 am

ESP32 http server httpd_uri_match_wildcard

Postby JSchaef » Fri Jan 25, 2019 8:50 am

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

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: ESP32 http server httpd_uri_match_wildcard

Postby ESP_igrr » Fri Jan 25, 2019 11:02 am

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

JSchaef
Posts: 13
Joined: Fri Jan 25, 2019 8:39 am

Re: ESP32 http server httpd_uri_match_wildcard

Postby JSchaef » Fri Feb 01, 2019 8:09 am

Hi ESP_igrr,
that's what I'm looking for - thank you.
Regards
Jorg

Who is online

Users browsing this forum: artisdom, Baidu [Spider], Sang_Huynh and 188 guests