I am using NodeMCU and trying to GET a text file from my server using the code below...
conn=net.createConnection(net.TCP, false)
conn:on("receive", function(conn, payload) print(payload) end)
conn:connect(80,"myserver")
conn:send("GET /test.txt HTTP/1.1\r\nHost: myserver\r\n"
.."Connection: keep-alive\r\nAccept: */*\r\n\r\n")The payload variable prints without a problem, however, I want to edit the payload variable once I've received it from the server, but nil is returned when I execute a second print...
print(payload)How can I get access to the txt file?!
Many thanks,
George