33 lines
1 KiB
Bash
Executable file
33 lines
1 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
set -eo pipefail
|
|
|
|
export BABASHKA_CLASSPATH=$(clojure -Sdeps '{:deps {clj-http-lite {:git/url "https://github.com/borkdude/clj-http-lite" :sha "f44ebe45446f0f44f2b73761d102af3da6d0a13e"}}}' -Spath)
|
|
|
|
if [ "$BABASHKA_TEST_ENV" = "native" ]; then
|
|
BB_CMD="./bb"
|
|
else
|
|
BB_CMD="lein bb"
|
|
fi
|
|
|
|
$BB_CMD -e "
|
|
(require '[clj-http.lite.client :as client])
|
|
|
|
(prn (:status (client/get \"https://www.clojure.org\")))
|
|
|
|
(prn (:status (client/get \"https://postman-echo.com/get?foo1=bar1&foo2=bar2\")))
|
|
|
|
(prn (:status (client/post \"https://postman-echo.com/post\")))
|
|
|
|
(prn (:status (client/post \"https://postman-echo.com/post\"
|
|
{:body (json/generate-string {:a 1})
|
|
:headers {\"X-Hasura-Role\" \"admin\"}
|
|
:content-type :json
|
|
:accept :json})))
|
|
|
|
(prn (:status (client/put \"https://postman-echo.com/put\"
|
|
{:body (json/generate-string {:a 1})
|
|
:headers {\"X-Hasura-Role\" \"admin\"}
|
|
:content-type :json
|
|
:accept :json})))
|
|
"
|