The v0.3.10f.20190822 update includes a feature developed by @Bloodtick_Jones to allow sending ad-hoc HTTP headers along with local and remote web requests. Previously only the Authorization and Content-Type headers were supported. See the original discussion here:
To use custom headers, set the Authorization Header field to a JSON object. Both the Value and Expression inputs work for typing in JSON, but I prefer the Expression editor since you can format on multiple lines:
'\{
"Header-A": "anteater",
"Header-B": "bumblebee"
\}'
Note that the {
and }
must be escaped with a backslash to avoid confusing the webCoRE expression parser. Both Value and Expression require this escaping, but as usual Value does not require the enclosing single quotes.
The expression used here must resolve to text with valid JSON encoding. Use the json()
function to properly encode values that may contain a double quote character. The json function is also useful for safely encoding data from a variable. In the Expression input:
'\{
"x-foo": {json('a"b')}
\}'
The String list (text) variable type can also be used for these headers, provided that the piston always sends the same set of headers since you cannot remove a key once it has been added to a list. Use the Set Variable action and provide the header name in list index. Then simply use the expression json(myHeaderList)
with your string list variable in the Authorization Header field. This approach automatically outputs the {}
braces and encodes values properly.
Device selection by capability
This release also splits the list of capabilities in the webCoRE smart app into three pages. This addresses issues that some users were having with selecting devices that did not appear in the actuators and sensors lists. With a large number of devices, the SmartThings platform could timed out while loading the capabilities list page, so it has been divided alphabetically into three pages.