HTTP POST Header

373 views
Skip to first unread message

Janik De Goÿ

unread,
Jan 17, 2018, 6:04:56 AM1/17/18
to Loxone English
Hello,
Does anyone know how we can control the header data of an HTTP POST virtual output command?

Virtual Output - Address field contains; the hostname
Virtual Output Command - Command for ON field contains; /restoftheTargetAPIURI
Virtual Output Command - HTTP Post command for ON contains;
Authorization: Bearer 6fd2c9f940c0f3243c3d1b3d1bb9e76\r
Content-Type: application/json\r
\r
{"mode":"sync", "messageType":"0f8453105c3b9faf7886", "messages":[{"celcius":29.3, "humidity":59.9, "timestamp":"2017-01-15T11:55:37.930Z"}]}

Anyone a better suggestion to be able to determine the header data?
Thanks for your help!

Janik De Goÿ

unread,
Jan 18, 2018, 3:06:35 AM1/18/18
to Loxone English
The correct answer is to use the "HTTP extensions for On" field and the right combination of carriage returns and line feeds.
Many thanks to https://github.com/menecio to help me find this out!
For below example this becomes:
Virtual Output Command - HTTP extensions for On; Authorization: Bearer 6fd2c9f940c0f3243c3d1b3d1bb9e76\r\nContent-Type: application/json
Virtual Output Command - HTTP Post command for ON; {"mode":"sync", "messageType":"0f8453105c3b9faf7886", "messages":[{"celcius":\1, "humidity":66.6, "timestamp":"2017-01-15T11:55:37.930Z"}]}

Note that the \n is added by using Enter key in the field box so if you use Enter all you have to add is the "\r". You can see the final string by hoovering over the field content.

Now the next step; passing on values from the Loxone system.
Reply all
Reply to author
Forward
0 new messages