esp_http_server: How do I override built-in 404 handler?

mchahn
Posts: 17
Joined: Fri Sep 18, 2020 6:31 am

esp_http_server: How do I override built-in 404 handler?

Postby mchahn » Sat Jun 12, 2021 11:09 pm

I'm using esp_http_server in a esp32-cam. I want to do some processing when I return a 404. The library seems to be returning the 404 responses without using my code. How can I handle the 404 and override the built-in one?

Victoria Nope
Posts: 75
Joined: Fri Dec 04, 2020 9:56 pm

Re: esp_http_server: How do I override built-in 404 handler?

Postby Victoria Nope » Sun Jun 13, 2021 7:12 am

You can register your own error handler with the httpd_register_err_handler function.

mchahn
Posts: 17
Joined: Fri Sep 18, 2020 6:31 am

Re: esp_http_server: How do I override built-in 404 handler?

Postby mchahn » Mon Jun 14, 2021 3:45 am

Thanks. I really did try to figure it out in the docs.

Who is online

Users browsing this forum: No registered users and 113 guests