arduino-libraries / Ethernet

Ethernet Library for Arduino
http://arduino.cc/
259 stars 264 forks source link

Create WebClientReadResponse.ino #56

Closed martinius96 closed 3 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.

CLAassistant commented 3 years ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.