I'm trying to access the contents of a webpage from my lua code. The following code works for non-HTTPS pages
local http=require("socket.http")
body,c,l,h = http.request("http://www.example.com:443")
print("status line",l)
print("body",body)
But on HTTPS pages, i get the following error.
Your browser sent a request that this server could not understand.
Reason: You're speaking plain HTTP to an SSL-enabled server port.
Instead use the HTTPS scheme to access this URL, please.
Now i did my research, some people recommends using Luasec, but i couldn't get it to work, no matter how much i tried. Also Luasec is a bit more complicated of a library than what i'm looking for. The page i'm trying to fetch only contains a json object as follows:
{
"value" : "false",
"timestamp" : "2017-03-06T14:40:40Z"
}