A janet http client
Add to your project.janet
file
{:dependencies ["https://github.com/joy-framework/http"]}
On Debian and Debian-like Linux distros, such as Ubuntu, you need libcurl4-openssl-dev
--
sudo apt install libcurl4-openssl-dev
On Fedora, CentOS, and RHEL-like distros, you need libcurl-devel
--
sudo dnf install libcurl-devel
(import http)
Send get requests!
(= @{:status 200 :body "..." :headers {"Content-Type" "text/html; charset=UTF-8" ...}}
(http/get "example.com"))
... and post requests!
(http/post "example.com" "param1=value1¶m2=value2")
follow redirects!
(http/get "httpstat.us/302" :follow-redirects true)
send custom http methods too!
*head, trace, delete, put, and patch supported
(http/delete "example.com/accounts/1")
Specify a port:
(http/get "example.com:9001", ...)