I’m trying to get rid of HTTP Binding by implementing a DSL Rule which periodically sends a GET-Request.
Since the request needs some headers to get the data in json I’m trying to use sendHttpGetRequest(String url, Map<String, String> headers, int timeout) as described in https://www.openhab.org/docs/configuration/actions.html#http-actions.
Unfortunately this gives me the following error:
2020-03-06 09:47:00.536 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Error during the execution of startup rule 'Get next recordings': Could not invoke method: org.eclipse.smarthome.model.script.actions.HTTP.sendHttpGetRequest(java.lang.String,int) on instance: null
It looks like the ability to include headers was added to the core on December 19, which is after the 2.5.0 release was made. This means the feature will be in 3.0, which won’t be out until later this year.
If you look at the 2.5 version of the docs, you won’t find that API. Note that you can select the doc version in the upper right corner of each page of the documentation.
I suppose one could argue that the default version of the doc should be “2.5”, not “latest”.
@Kai@ysc@Confectrician Shouldn’t the default version of the documentation be “2.5” instead of “latest”? I don’t think too many people will notice the drop down at the top of the page. As a result they will be confused when they see features that are in the docs but don’t work.
Apologize in advance if this is already on someone’s radar screen.
Ah, I see now. I was just thinking openhab-core, which is stuck at 2.5. So the 2.5 tag means the 2.5 release?
And now I understand why “latest” is there - to account for all the 2.5.x bindings, which will continue to change as PRs are merged.
Maybe it was the fact that the sendHttpGetRequest “latest” doc included a 3.0 change. But that was just a timing issue with the change to core versus the introduction of the versioning mechanism.
Yes I have branched out the 3.x docs on Feb 10th, before that it’s possible that changes meant for 3.x ended up in what is now the 2.5.x docs; FTR, there should no mentions of openHAB 3 on https://www.openhab.org/docs for now, the site for the upcoming OH3 is now sitting at https://next.openhab.org and is completely separate, so we’re completely free to do a - much needed IMO - overhaul of the docs without worry.
When openHAB 3 and its docs are in good shape, of course, there will be a link or banner to get to the “next” website for interested visitors until it eventually replaces the production one.
But be aware that the “edit this page” link seems to have a bug due to our latest changes, which i have recognized just while looking at this post and page.
Please make sure to give your pull request a proper “2.5.x” title, so we can sort that out and get the changes into the right place.
I will add an issue for the wrong edit links and will try to fix them asap.