nikintharan / openhab

Automatically exported from code.google.com/p/openhab
0 stars 0 forks source link

How to update item's state?? #242

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I want to update an item's state

so i use a library "Httpclient" to send HTTP GET or POST request to openHAB 
server

for example, the uri is 
http://localhost:8080/rest/items/Light_FF_Bath_Ceiling/state

for GET request, openHAB server response the right state "OFF"

for POST request, openHAB server response "HTTP/1.1 405 Method Not Allowed"

but i read the REST page https://code.google.com/p/openhab/wiki/REST,
openHAB server can support POST request.

why i cannot?
hope guys can answer me, thanks..

Original issue reported on code.google.com by duanruiq...@gmail.com on 18 Apr 2013 at 12:19

GoogleCodeExporter commented 8 years ago
The wiki page says that you have to use PUT for updating the state.

POST can only be used for triggering commands for an item and then the correct 
uri is without the /state suffix.

Original comment by kai.openhab on 18 Apr 2013 at 12:22