Sample Janet module that provides a simple libcurl wrapper
See jurl for a full featured wrapper of libcurl
jpm clean
jpm build
jpm test
cat sample.janet | janet -q -e
janet -e '(import build/jhttp :as jhttp)' -e '(print (jhttp/get "https://postman-echo.com/get?foo1=bar1&foo2=bar2"))'
janet
Janet 1.3.1-944347e Copyright (C) 2017-2019 Calvin Rose
janet:1:> (import build/jhttp :as http)
nil
janet:2:> (http/get "https://postman-echo.com/get?foo1=bar1&foo2=bar2")
201 bytes retrieved
"{\"args\":{\"foo1\":\"bar1\",\"foo2\":\"bar2\"},\"headers\":{\"x-forwarded-proto\":\"https\",\"host\":\"postman-echo.com\",\"accept\":\"*/*\",\"x-forwarded-port\":\"443\"},\"url\":\"https://postman-echo.com/get?foo1=bar1&foo2=bar2\"}"a
[x] GET
[ ] POST
[ ] DELETE