Skip to content

Instantly share code, notes, and snippets.

@JustinAiken
Created May 6, 2015 20:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JustinAiken/b1ceee399386cbf0bdfc to your computer and use it in GitHub Desktop.
Save JustinAiken/b1ceee399386cbf0bdfc to your computer and use it in GitHub Desktop.
curls
# Check state locally:
$ curl http://pi:8080/rest/items/my_item/state
CLOSED
# Set state through locally via PUT:
$ curl --header "Content-Type: text/plain" --request PUT --data "OPEN" http://pi:8080/rest/items/my_item/state
# Immediately changes
# Check state through myopenhab:
$ curl --user myuser:mypass https://my.openhab.org/rest/items/my_item/state
CLOSED
# Try to update state through myopenhab:
$ curl --user myuser:mypass --header "Content-Type: text/plain" --request PUT --data "CLOSED" https://my.openhab.org/rest/items/my_item/state
# Request times out
# In openhab log I see: '2015-05-06 19:29:50.940 [ERROR] [.myopenhab.internal.MyOHClient] - Unsupported request method PUT'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment