31.10.2016, 07:44
200 status means that requests work correctly, you just have to get the response like this:
Code:
-- load required modules
http = require("socket.http")
mime = require("mime")
ltn12 = require("ltn12")
t = {}
r, c, d, e = http.request {
url = "http://demo.traccar.org/api/positions/",
headers = { authorization = "Basic " .. (mime.b64("login:password")) },
sink = ltn12.sink.table(t)
}
response = table.concat(t)
log(response)