]> git.basschouten.com Git - openhab-addons.git/commitdiff
[http] Added example and explanation how to provide multiple headers (#10141)
authormgwoj <32574975+mgwoj@users.noreply.github.com>
Sun, 14 Feb 2021 03:44:34 +0000 (04:44 +0100)
committerGitHub <noreply@github.com>
Sun, 14 Feb 2021 03:44:34 +0000 (19:44 -0800)
bundles/org.openhab.binding.http/README.md

index 998e394d49ade30b1a1deb893a23ba07b1fe1d36..c9e5c9ebe4a1e5a3ee531030439b10957c042797 100644 (file)
@@ -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" ]
+}
+```