Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By andrew melvin
#13320 Is there a call or function to return the number of params that have been entered by the browser.

I'm using forms, and I want to know when the request has finished to save things to the eeprom. Only the number of fields completed is not known.

For a form where defaults are filled out I know there are 4, so I can count through the loop then act. For another form I can't so it would be useful to have a when var == server.paramscount() then....

Also what does client.flush() do?

Cheers!
User avatar
By gerardwr
#13326
andrew melvin wrote:Is there a call or function to return the number of params that have been entered by the browser.
...


No, you will have to scan the URL that the browser sent yourself.

The various parameters are probably separated by an & sign (something like &var1=123&var2=56). So you need some kind of loop:
- locate the & sign
- get the name of the parameter
- get the value of the parameter
- and again till the the URL is completely processed.

I am sure if you load at other Arduino example you will find something you can use.

Good luck.