Hi,
I want to write some lua code that does the same thing as this curl command:
curl -X GET https://www.web-site.net/aaa/bbb -u username:password -k --digest
Notice the --digest switch at the end. This is what is causing me headaches I think.
I have gotten this far:
[code]local socket = require(“socket”)
local https = require(“ssl.https”)
local ltn12 = require(“ltn12”)
https.TIMEOUT = 5
https.PORT=443
local body, code, headers, status = https.request{
url = “https://username:password@www.web-site.net/aaa/bbb”}
}
[/code]
Status reports “HTTP/1.1 401 Unauthorized” so I conclude that the username/password is not being passed correctly. I suspect this is because the site requires Digest Authentication.
I’ve not found any examples for Digest Authentication code with Lua. Given that the curl command works fine the Vera3 supports Digest authentication, but how is this done in lua code, as I’d prefer not calling curl?