Skip to main content



      Home
Home » Archived » Eclipse SmartHome » REST : ItemResource : only PUT to update state?
REST : ItemResource : only PUT to update state? [message #1746454] Sat, 29 October 2016 08:31 Go to next message
Eclipse UserFriend
I have an external system that can provides updates about it state using HTTP. It can be configured to make an ordinary GET HTTP call only.

I was wondering how such a system could be linked to ESH via REST given that the ItemResource class specifies that only PUT is supported as a method to update the state of an Item. Is there a specific reason GET is not supported, or what would be alternative strategy to include this external system in the ESH realm without having to implement a specific binding?

Re: REST : ItemResource : only PUT to update state? [message #1746484 is a reply to message #1746454] Sun, 30 October 2016 18:23 Go to previous message
Eclipse UserFriend
According to REST principles, GET requests must be safe methods, i.e. "they are intended only for information retrieval and should not change the state of the server".
So your system not implemented in a conform way.

There are ways to integrate it nonetheless:
1. Implement a binding in which you register a servlet that deals with the specific GET calls from your external system
2. If you do not want to do any coding, you could consider to re-(mis-)use the CMD servlet of the ClassicUI, which accepts GET requests to set states like e.g. http://demo.openhab.org:8080/classicui/CMD?Weather_Temperture=2.
Previous Topic:LOG & EVENTS
Next Topic:list of channels
Goto Forum:
  


Current Time: Thu Jul 17 14:11:23 EDT 2025

Powered by FUDForum. Page generated in 0.10997 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top