11.01.2020, 12:30
Try the code below and see what you get in the log. That's the response from your system. Please change the url to the correct url to make it work.
local http = require "socket.http"
local data = ""
local function collect(chunk)
if chunk ~= nil then
data = data .. chunk
end
return true
end
local ok, statusCode, headers, statusText = http.request {
method = "GET",
url = "http://192.168.5.176/cgi/WebCGI?1500101=...tent=Hello",
sink = collect
}
log("ok\t", ok);
log("statusCode", statusCode)
log("statusText", statusText)
log("headers:")
for i,v in pairs(headers) do
log("\t",i, v)
end
log("data", data)
local http = require "socket.http"
local data = ""
local function collect(chunk)
if chunk ~= nil then
data = data .. chunk
end
return true
end
local ok, statusCode, headers, statusText = http.request {
method = "GET",
url = "http://192.168.5.176/cgi/WebCGI?1500101=...tent=Hello",
sink = collect
}
log("ok\t", ok);
log("statusCode", statusCode)
log("statusText", statusText)
log("headers:")
for i,v in pairs(headers) do
log("\t",i, v)
end
log("data", data)