I'm using the httpd_req_t struct. I need to edit the uri field (to decode characters from the %NN formatting), but it's a const. I've looked at creating a new struct, and initializing it like this:
Code: Select all
esp_err_t wildcard_handler(httpd_req_t *req)
{
const struct fluidra_http_page_t *page = ap_web_pages;
// ESP_LOGI(TAG, "wildcard_handler: starting.");
static char buff[513];
if (page->url != 0x0) {
// buff = malloc(strlen(req->uri));
uri_decode((void *) req->uri, strlen(req->uri), buff);
httpd_req_t newReq = {
.handle = req->handle,
.method = req->method,
// .uri = buff,
So, how does one go about dynamically creating such a struct?
Thanks...