16.07.2019, 09:53
(16.07.2019, 09:09)admin Wrote: Thanks, turns out that example is incorrect. Correct header name should be authorization, not authentication. You also need to add sink table to the GET request so you can retrieve response data.
Did you receive a response with a device in it?
Code:
mime = require("mime")
local cReq2 = {}
local cUrl2 = 'https://api.cp.dyson.com/v1/provisioningservice/manifest'
result2, c, h = https.request({
url = cUrl2,
method = 'GET',
headers = {
['authorization'] = "Basic " .. mime.b64(cAccount..":"..cPassword)
},
sink = ltn12.sink.table(cReq2)
})
log(result2,c,h)
log(cReq2)
Now my response is a correct http request (code 200), but no data in cReq2