Created
February 20, 2023 14:09
-
-
Save nakov/57d0cb71d933eec8606f86e39de2523b to your computer and use it in GitHub Desktop.
Shelly HTTP GET
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
Shelly.call( | |
"HTTP.GET", | |
{"url": "https://api.zippopotam.us/us/90210"}, | |
function (response) { | |
if (response && response.code && response.code === 200) { | |
print(JSON.stringify(response.body)); | |
Shelly.emitEvent("HTTP-result", response.body); | |
} | |
else { | |
print("Error: HTTP request failed."); | |
} | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks!