Last active
November 3, 2016 11:48
-
-
Save LarsBergqvist/13e0ca63b6ea34a028a893862f113121 to your computer and use it in GitHub Desktop.
Examples on REST calls to my api that controls 433MHz remote controlled outlets via a Raspberry Pi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Examples on REST calls to the api | |
# Replace localhost:5000 with the IP-address and port of the machine where the api is running | |
# List all defined outlets (GET) | |
curl -i http://localhost:5000/Outlets/api/outlets | |
# Turn on power for outlet 1 in group 2 | |
curl -i -H "Content-Type: application/json" -X PUT -d '{"state":"on"}' http://localhost:5000/Outlets/api/outlets/2/1 | |
# Turn on power for outlet 3 in group 1 | |
curl -i -H "Content-Type: application/json" -X PUT -d '{"state":"on"}' http://localhost:5000/Outlets/api/outlets/1/3 | |
# Turn off power for outlet 3 in group 1 | |
curl -i -H "Content-Type: application/json" -X PUT -d '{"state":"off"}' http://localhost:5000/Outlets/api/outlets/1/3 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment