function create_server()
sv=net.createServer(net.TCP, 30)
sv:listen(88,function(c)
c:on("receive", function(c, pl) print(pl) end)
end)
endworking, fine, from other pc, i do a get http://ip_esp8266:88/hello/bye/ and in the esp8266 i see:
GET /hello/bye/ HTTP/1.1
Host: 192.168.84.107:88
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Linux; Android 5.0.2; C6833 Build/14.5.A.0.242) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.133 Mobile Safari/537.36
Accept-Encoding: gzip, deflate, sdch
Accept-Language: es-ES,es;q=0.8,en;q=0.6
My question is: how can i get variables with the string 'hello' and other with the string 'bye'? In a linux machine i do something like:
var1=$(echo $pl | grep ^GET | cut -f2 -d\/)
var2=$(echo $pl | grep ^GET | cut -f3 -d\/)Please help!