I am looking for the example how to specify multiple headers in the definition of the http binding. I know that I can enter them using UI interface, but as I keep all my configuration in the text files, I would like to do that inside things file.
According to the documentation HTTP - Bindings | openHAB headers’ Format is “header=value”., but there is no example for to provide several headers. Single header works, but none of the combinations using , or newline.
Please help me with correcting this definition
Thing http:url:foo "Foo" [
baseURL="https://example.com/api/v1/metadata-api/web/metadata",
headers="key1=value1,key2=value2,key3=value3",
refresh=15] {
Channels:
Type string : text "Text" [ stateTransformation="JSONPATH:$.metadata.data" ]
}
I also use files for the HTTP binding. One thing you can try is setup your Things and Channels using the UI, then switch to the Code tab to view the YAML that has been created. You can then use this to derive the Things file configuration. Feel free to post the YAML here and we can try…
I know about Code tab, but it is providing thing definition in yaml format, which is not compatible with syntax for things files. It the yaml format there is not problem with defining multiple headers.