Hi all,
Recently migrating a project from an ESP to Teensy 4.1.
My old code used ESP8266WebServer.h and now I'm moving over to NativeEthernet.
Here's what I've been able to successfully do so far:
What isn't really clear is how to process the data. I need the syntax to be able to get to my form data. I've been using the googles to try to find some documentation on the library, and have come up empty handed. In the ESP library, it was as simple as taking server.arg(0) (First form element value), server.arg(1) (Second Form element value), etc.
So effectively I've got a form with a bunch UX elements that I want the user to interact with and when they "post" have the Teensy do it's thing (in this case, control a bunch of LEDs). I've also gotten the Teensy able to drive the LED's with different patterns, etc, so I got that part working as well... I just need to marry these together.
If anyone has an example of handling a POST in the webserver and managing the form elements, I can take it from here.
Thanks in advance,
J
Recently migrating a project from an ESP to Teensy 4.1.
My old code used ESP8266WebServer.h and now I'm moving over to NativeEthernet.
Here's what I've been able to successfully do so far:
- Get the Teensy on my network
- Enable mDNS and a basic webserver
- Get a client to connect; The Teensy is serving up my HTML/CSS/jScript and it renders great.
- Looking at the serial output, the POST is coming through!
What isn't really clear is how to process the data. I need the syntax to be able to get to my form data. I've been using the googles to try to find some documentation on the library, and have come up empty handed. In the ESP library, it was as simple as taking server.arg(0) (First form element value), server.arg(1) (Second Form element value), etc.
So effectively I've got a form with a bunch UX elements that I want the user to interact with and when they "post" have the Teensy do it's thing (in this case, control a bunch of LEDs). I've also gotten the Teensy able to drive the LED's with different patterns, etc, so I got that part working as well... I just need to marry these together.
If anyone has an example of handling a POST in the webserver and managing the form elements, I can take it from here.
Thanks in advance,
J