From 90ff809cb62fa95f645ce931d2bee294df4e9e73 Mon Sep 17 00:00:00 2001 From: mgwoj <32574975+mgwoj@users.noreply.github.com> Date: Sun, 14 Feb 2021 04:44:34 +0100 Subject: [PATCH] [http] Added example and explanation how to provide multiple headers (#10141) --- bundles/org.openhab.binding.http/README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.http/README.md b/bundles/org.openhab.binding.http/README.md index 998e394d4..c9e5c9ebe 100644 --- a/bundles/org.openhab.binding.http/README.md +++ b/bundles/org.openhab.binding.http/README.md @@ -23,7 +23,7 @@ It can be extended with different channels. | `commandMethod` | no | GET | Method used for sending commands: `GET`, `PUT`, `POST`. | | `contentType` | yes | - | MIME content-type of the command requests. Only used for `PUT` and `POST`. | | `encoding` | yes | - | Encoding to be used if no encoding is found in responses (advanced parameter). | -| `headers` | yes | - | Additional headers that are sent along with the request. Format is "header=value".| +| `headers` | yes | - | Additional headers that are sent along with the request. Format is "header=value". Multiple values can be stored as `headers="key1=value1", "key2=value2", "key3=value3",`| | `ignoreSSLErrors` | no | false | If set to true ignores invalid SSL certificate errors. This is potentially dangerous.| *Note:* Optional "no" means that you have to configure a value unless a default is provided and you are ok with that setting. @@ -169,3 +169,17 @@ is transformed to ``` http://www.domain.org/home/lights/23871/?status=OFF&date=2020-07-06 ``` + +## Examples + +### `demo.things` + +``` +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" ] +} +```