Closed GoogleCodeExporter closed 9 years ago
Hi Thomas, what do you think about this? Might be useful, we just have to be
careful that the syntax does not get too bloated.
Original comment by kai.openhab
on 22 Nov 2012 at 9:10
Original comment by teichsta
on 22 Nov 2012 at 9:47
Actually I see that ':' character is used for pattern matching and to do not
interfere with already existing implementation I would suggest slightly
different format of binding config string:
http="<[url{header1=value1&header2=value2}:refreshinterval:transformation-rule]"
example:
http="<[https://www.flukso.net/api/sensor/xxxx?interval=daily{X-Token=mytoken&X-
version=1.0}:60000:REGEX(.*?<title>(.*?)</title>(.*))]"
headers are put between {} in the url part and actually it should be optional
to add {headers} part, so old syntax still should work.
I will give it a try and commit it in clone of openhab project once it is ready
Original comment by ramazany...@gmail.com
on 9 Dec 2012 at 12:18
I made changes to the source in my cloned repository named
ramazanyich-httpbinding-headers.
The change is rather small. I also added necessary unit tests to new format.
Could you please review it and add to the main project source?
Thanks in advance.
Original comment by ramazany...@gmail.com
on 9 Dec 2012 at 10:16
merged enhancement to default branch (see
http://code.google.com/p/openhab/source/detail?r=2e5a6323c475feeb9ab0fe5dc52bef1
20e149780)
Original comment by teichsta
on 16 Dec 2012 at 3:38
[deleted comment]
Please update wiki for the HTTP binding.
Add section:
'HTTP headers in the binding.
Both OutBinding and InBinding has possibility to define optional HTTP headers
which will be sent during HTTP method call. Those optional headers could be
added to the url in form header1=value1&header2=value2.... This headers string
should be enclosed into curly brackets right after the url itself (before
separation colon).
Example:
http="<[https://www.flukso.net/api/sensor/xxxx?interval=daily{X-Token=mytoken&X-
version=1.0}:60000:REGEX(.*?<title>(.*?)</title>(.*))]"
'
Original comment by ramazany...@gmail.com
on 17 Dec 2012 at 7:57
Thanks, I have updated the wiki page accordingly.
Original comment by kai.openhab
on 17 Dec 2012 at 10:17
Original issue reported on code.google.com by
ramazany...@gmail.com
on 21 Nov 2012 at 10:32