Skip to content
This repository was archived by the owner on Jan 13, 2021. It is now read-only.

Commit 5fc3d77

Browse files
committed
Basic get-ip example in Hylang
1 parent 5314252 commit 5fc3d77

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

examples/ip.hy

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
(import hyper json)
2+
3+
(defn http2bin [path]
4+
(let [[conn (hyper.HTTPConnection "http2bin.org")]]
5+
(.request conn "GET" path)
6+
(-> (.get_response conn) (.read) (json.loads))))
7+
8+
(-> (http2bin "/ip") (get "origin") (print))

0 commit comments

Comments
 (0)