Excellent resource. Thank-you very much for taking the time to put his together. A significant amount of work.
I'm looking to better understand what is going on with a few of the ESP8266WebServer library methods.
Referring to the WebUpdate example:
Regarding sendHeader(const String& name, const String& value, bool first = false) method.
-
Does it actually send anything to the client or is it just preparing parts of the header for the next time a send() method is called? (Meaning the method name is more akin to setHeader()?)
-
sendHeader() seems to operate on a key:value model where name is the key and value is what is set against that key? Meaning name is the literal text to be included in the response header and value is the literal text that follows name? (Assuming as well the method inserts : between the pair?)
-
Can multiple calls to sendHeader() be made to build up the desired header?
-
Is the name parameter limited to certain text strings? If so, where are those enumerated?
-
What is the effect on the header of using the first parameter? Does it change the order of elements assembled by previous sendHeader() calls?
-
What is used to create the rest of the header after call(s) to sendHeader()? As in, after call(s) to sendHeader(), what is is the final text of the header?
Regarding on(const Uri &uri, HTTPMethod method, THandlerFunction fn, THandlerFunction ufn)
As used in line 34, it has 4 parameters.
-
For the method parameter, most examples use HTTP_POST or HTTP_GET. What do these expand to and where are they enumerated?
-
Trying to understand the 4th parameter, ufn. It seems to be the function called to handle file uploads. But under what conditions, or what triggers it to be called instead of the 3rd parameter, fn?
-
Why prefer that method over using onFileUpload(THandlerFunction fn)?
Thanks for reading this far. Any insight would be appreciated.
Excellent resource. Thank-you very much for taking the time to put his together. A significant amount of work.
I'm looking to better understand what is going on with a few of the ESP8266WebServer library methods.
Referring to the WebUpdate example:
Regarding
sendHeader(const String& name, const String& value, bool first = false)method.Does it actually send anything to the client or is it just preparing parts of the header for the next time a
send()method is called? (Meaning the method name is more akin tosetHeader()?)sendHeader()seems to operate on a key:value model wherenameis the key andvalueis what is set against that key? Meaningnameis the literal text to be included in the response header andvalueis the literal text that followsname? (Assuming as well the method inserts:between the pair?)Can multiple calls to
sendHeader()be made to build up the desired header?Is the
nameparameter limited to certain text strings? If so, where are those enumerated?What is the effect on the header of using the
firstparameter? Does it change the order of elements assembled by previoussendHeader()calls?What is used to create the rest of the header after call(s) to
sendHeader()? As in, after call(s) tosendHeader(), what is is the final text of the header?Regarding
on(const Uri &uri, HTTPMethod method, THandlerFunction fn, THandlerFunction ufn)As used in line 34, it has 4 parameters.
For the
methodparameter, most examples useHTTP_POSTorHTTP_GET. What do these expand to and where are they enumerated?Trying to understand the 4th parameter,
ufn. It seems to be the function called to handle file uploads. But under what conditions, or what triggers it to be called instead of the 3rd parameter,fn?Why prefer that method over using
onFileUpload(THandlerFunction fn)?Thanks for reading this far. Any insight would be appreciated.