sstaub / Ethernet3

Ethernet library for Arduino and Ethernetshield2 / WIZ550io / WIZ850io / USR-ES1 with Wiznet W5500 chip
Other
76 stars 34 forks source link

Create WebClientReadResponse.ino #14

Closed martinius96 closed 6 years ago

martinius96 commented 6 years ago

Read response from server and parse variable from txt file or php script, html etc, very easily.

This parser created by me serves to read the response from the webserver and parse the variable found in a file. The most common is the .txt file, or any line of php code that is cut off as needed. In the example provided by me,

I have set the answer reading from my site with the appropriate number of rows. On each webserver, the number of rows is different due to the length of the header. This is changing, for example, due to the use of another engine (Nginx, Apache, Xampp, Wamp), operating system.

You can determine the number of response lines on your site from the number of lines received, and replace that number instead of the number 12 in the code. There: else if (x==12) readString += c; //our variable My webserver response for instance: Image of response I'd like to provide additional information about reading this line of response. This is a very practical thing especially for relay control over the Internet, IoT, Intelligent homes and similar interactive projects where Ethernet is used.