The ESP8266Webserver built in key-name pair parser does a nice job of accessing the arguments by name or by index.
For example, it is almost trivial to process the following http get request
http://retic.local/datetime_config_update?year=2024&month=10&day=10&hour=16&minute=27&second=23
by referring to the arguments like this
manSetTime(server.arg ("year" ).toInt(), \
server.arg ("month" ).toInt(), \
server.arg ("day" ).toInt(), \
server.arg ("hour" ).toInt(), \
server.arg ("minute" ).toInt(), \
server.arg ("second" ).toInt() \
);
I also want the user to be able to set Date/Time using Serial input (because feature creep). There appears to be many command line parser librarys available but was hoping the parser in the ESP8266Webserver library could be re-used and save some resources.
I had a poke around in the library files but I think the code is many levels above what I can grasp.
As such I was hoping someone may have already done this and could give some hints. Hints in terms of if its do-able or a waste of time and would be better to use one of the fore mentioned parser librarys.
I found Parsing-impl.h at C:\data\arduino-1.8.19\portable\packages\esp8266\hardware\esp8266\3.1.2\libraries\ESP8266WebServer\src
and it contains code that looks like it processes the arguments but I cant see how to reuse it.
I was hoping I could create a object of type some class then pass a string like :year=2024&month=10&day=10&hour=16&minute=27&second=23" and have it do the hard work.
Any suggestions
&, and then by=to get keys and values.