I'm a newbie on LUA + ESP8266 and this is my first post on the forum
I'm doing a HTTP GET request to a website (web.tecnico.ulisboa.pt/ist167599/state.php) using this code:
-- Configure as simple http client
conn=net.createConnection(net.TCP, false)
conn:on("receive", function(conn, pl) print(pl) end) -- Recieve
conn:connect(80,"193.136.128.24") -- Public IP Adress of your router forwared to port 80
conn:send("GET /ist167599/state.php HTTP/1.1\r\nHost: web.tecnico.ulisboa.pt\r\n"
.."Connection: close\r\nAccept: */*\r\n\r\n")The state.php file, on the website, is just a simple echo:
<?php
echo "State1";
?>When I do the HTTP GET request I can receive all the information, incluiding the "State1", but I'm being unable to save the request in a string and search wether or not "State1" is in the php file.
I've searched a lot and I haven't find anything. I was able to do it on Arduino, but I'm really stuck on the lua code to do it. Any help is appreciated
Thank you ALL in Advance!