Welcome to Smart Home Forum by FIBARO
Dear Guest,
as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.
As a member you can:
- Start new topics and reply to others
- Follow topics and users to get email updates
- Get your own profile page and make new friends
- Send personal messages
- ... and learn a lot about our system!
Regards,
Smart Home Forum by FIBARO Team

Question
747 18
Hi,
I have been using api.dryg.net to get day info and it has been working great until a couple of days ago.
I get Error 301, which i assume is due to webpage is not HTTP anymore, instead only HTTPS is supported.
Before i used a VD and used Net.FHttp :
local httpSession = Net.FHttp(ip, port);
local date = os.date("%Y/%m/%d");
response, status, errorCode = httpSession:GET("/dagar/v2.1/"..date)
If i have understood it correctly, i need to use a http:request instead and this can only be done from a scene?
When i do the following from a scene i get this:
local httpSession = net.HTTPClient();
httpSession:request("https://api.dryg.net/dagar/v2.1/" ..date, {
options = {method = 'GET', timeout = 5000 },
success = function(status)
print(status.status)
if status.status ~= 200 and status.status ~= 201 then print("failed"); end
print(status.data);
local results = json.decode(status.data)
for k,v in pairs(results) do print(k, v) end
end,
error = function(err)
print('[ERROR] ' .. err)
end
})
Response is :
[ERROR]End of file
Any idea what im doing wrong?
14 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.