Line 86:
void on(const String &uri, HTTPMethod method, THandlerFunction fn, THandlerFunction ufn);
This method is used in me-no-dev's "Webupdate" example which I'm trying to adapt to my project: (https://github.com/espressif/arduino-es ... /WebUpdate)
What is the difference between "THandlerFunction fn" & "THandlerFunction ufn"???
When I integrate this example into my project it works fine:
Code: Select all
HTTPserver.on("/update", HTTP_GET, []() { //Just presents the user with the update webpage for them to select a file
if (!handleFileRead("/update.htm")) HTTPERROR();
});
HTTPserver.on("/update", HTTP_POST, []() {
//What is this for?
}, []() { //Handles the file upload and update. It works fine
RequestAuthentication();
HTTPUpdateUpload();
});
But when I change the method to "void on(const String &uri, THandlerFunction handler);" it does not work, but seems like it should:
Code: Select all
HTTPserver.on("/update", HTTP_GET, []() {
if (!handleFileRead("/update.htm")) HTTPERROR();
});
HTTPserver.on("/update", HTTP_POST, []() { //Gets an unknown error from update. like its only calling it once
RequestAuthentication();
HTTPUpdateUpload();
});