First I capture the URL "/?waterPlant1" and check if it is greater than 0. That would mean it found the word we are looking for in the header recieved from the client browser.
Next I turn on the solenoid. However we want to keep it on for 10 seconds to so sufficient amout of water gets poured into pot(depending how big the pot is.) so instead of resetting the readString to empty string. I wait for 10 seconds, as soon as 10 seonds passes. it is reset to empty string and default of solenoid turns it off.
I hope it was useful for you. Let me know in case you need any help in the comments below.