OK, @ScruffR, I know I really didn't give any helpful details above. I seem to have pinned down the source (but not the cause) of the problem. Basically, I modified @randomguy1124's example from here: Using new SoftAP Http pages to configure other settings - #4 by randomguy1124
I can set the HTML FORM to use POST without an issue, as follows:
const char index_html[] = "<html><div align=\"center\"><form action=\"color\" method=\"post\"><input id=\"background-color\" name=\"color\" type=\"color\"/><input type=\"submit\" value=\"Go!\"/></form></div></html>";
The problem arises when I specify the EncType attribute of the HTML FORM bracket to text/plain
. There are three valid EncTypes to choose from, as follows:
application/x-www-form-urlencoded
DEFAULT if nothing specified
const char index_html[] = "<html><div align=\"center\"><form action=\"color\" method=\"post\" enctype=\"application/x-www-form-urlencoded\"><input id=\"background-color\" name=\"color\" type=\"color\"/><input type=\"submit\" value=\"Go!\"/></form></div></html>";
(or just omit the "enctype" argument altogether.) My difficulty with this is that I'd have to write a routine to correct all of the %xx hexadecimal escape sequences back into ASCII characters.
Output:
multipart/form-data
const char index_html[] = "<html><div align=\"center\"><form action=\"color\" method=\"post\" enctype=\"multipart/form-data\"><input id=\"background-color\" name=\"color\" type=\"color\"/><input type=\"submit\" value=\"Go!\"/></form></div></html>";
Output debug stream:
I don't know who wants to try to decipher that with a microcontroller, but it's there!
text/plain
const char index_html[] = "<html><div align=\"center\"><form action=\"color\" method=\"post\" enctype=\"text/plain\"><input id=\"background-color\" name=\"color\" type=\"color\"/><input type=\"submit\" value=\"Go!\"/></form></div></html>";
The web browser hangs (waiting for a 200 or 404 response), and the Photon does not indicate anything has happened. THIS IS WHAT I'M TRYING TO USE!
Does this help?