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
PiotrP 0
Hi,
I tried this.
Please login or register to see this code.
it works with GET end empty payload. But when I switch GET with PUT and fill the payload I receive:
Please login or register to see this image.
/monthly_2020_02/image.png.dcf2d727ccea9ffd4f91da380069b938.png" />the IP address is 192.168.1.101/write
What is the correct way to use PUT method?
Thanks!
--EDIT SOLUTION--
IThe correct format for sending PUT request is:
selfId = fibaro:getSelfId()
deviceIp = fibaro:get(selfId, "IPAddress") -- VD ip address
devicePort = fibaro:get(selfId, "TCPPort") -- VD port for ip
TERMI = Net.FHttp(deviceIp, devicePort) -- object definition
payload = '{"INTERVAL":"true","iTemp":"'..iTemp..'","iDuration":"'..iDuration..'"}' -- whatever payload you need, in my case some JSON objects
response ,status, errorCode = TERMI:PUT('/write' , payload) -- remember to include payload!
Best regards!
Edited by PiotrP4 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.