Skip to content

Instantly share code, notes, and snippets.

@nakov
Created February 20, 2023 14:09
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 nakov/57d0cb71d933eec8606f86e39de2523b to your computer and use it in GitHub Desktop.
Save nakov/57d0cb71d933eec8606f86e39de2523b to your computer and use it in GitHub Desktop.
Shelly HTTP GET
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