General Question: http vs. curl


I am thinking about requesting data from a website (DWD about pollen):
see here:

However, I am wondering if there is any advantage of using the http binding as in the thread above or if curl and jsonpath would to the job the same way?
Thanks in advance.

Well, it will be more efficient to use use the HTTP binding or HTTP Actions than to use Exec binding and curl. I’d only recommend using curl if there is some reason that the HTTP binding or Actions won’t work.

It is quite expensive to jump outside of OH and kick off an external application compared to calling something that is native. And I’ve seen some evidence that there are some minor issues with executeCommandLine at the least (it doesn’t appear to honor the timeout that is passed to it if the called program/script crashes).

Thanks for your response.

I remember having many issues with executeCommandline specifically.
However, most of my existing code helps me through the day in such a case :wink:

Then, why is the http binding still a 1.x binding?

An advantage of using the HTTP binding is that it the response is cached. If you’re requesting data from a service which allows you n number of request per day and you need to get multiple attributes from a JSON response this will only cost you a single request so you will have n-1 request left.

A 2.x binding is being developed: openhab2-addons.

That’s a good point.
Thanks, Marcel

The same reason any binding is still a 1.x binding. A new one hasn’t been written and approved. There is supposed to be a new 2.x version of the binding that should be released before OH 2.5 release.

Of course, sorry. I did not intend to be pushy :wink:
Thanks, Rich