-->
Page 1 of 1

Server.on Handler Function

PostPosted: Tue Aug 02, 2016 8:19 am
by roboticboyer
HI
I'm looking inside ESP8266WebServer.h

Which is the difference between the 2 below methods?
Code: Select allvoid on(const String &uri, HTTPMethod method, THandlerFunction fn);
void on(const String &uri, HTTPMethod method, THandlerFunction fn, THandlerFunction ufn);


Does the 2nd method allows to manage 2 Handler Functions?
For example is used at https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WebServer/examples/FSBrowser/FSBrowser.ino#L226
Which is the difference between fn e ufn?

Thank You
BR
Giorgio

Re: Server.on Handler Function

PostPosted: Tue Aug 02, 2016 8:38 am
by martinayotte
fn is the normal handler while ufn is the "upload" handler.

Re: Server.on Handler Function

PostPosted: Wed Aug 03, 2016 12:42 am
by roboticboyer
Thank You @martinayotte
Now is clear! ;) ;) ;)
In the linked example the 2nd method is used to upload a file inside the SPIFFS from the web by the "upload" handler function.

BR
Giorgio