Skip to content

Commit

Permalink
update mwe_07.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
ufechner7 committed Jul 26, 2024
1 parent 2484317 commit 426bc4d
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions mwes/mwe_07.jl
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

0 comments on commit 426bc4d

Please sign in to comment.