-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
17 additions
and
5 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,22 @@ | ||
# http example | ||
using HTTP | ||
using JSON3 | ||
using HTTP, JSON3, KiteUtils | ||
|
||
url = "http://localhost:8080" | ||
|
||
function get_data(url) | ||
response = HTTP.get(url) | ||
return JSON3.read(response.body) | ||
function init() | ||
response = HTTP.get(url*"/init") | ||
if response.status == 200 | ||
return JSON3.read(response.body) | ||
else | ||
return nothing | ||
end | ||
end | ||
|
||
function sys_state() | ||
response = HTTP.get(url*"/sys_state") | ||
if response.status == 200 | ||
return JSON3.read(response.body) | ||
else | ||
return nothing | ||
end | ||
end |