I have the following curl command from the github api that I wish to replicate in babashka:
curl \
-X POST \
-H "Accept: application/json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
https://api.github.com/user/repos \
-d '{"name":"test"}'
Currently, I have tried:
(ns bb-test
(require [environ.core :refer [env]]
[babashka.curl :as curl])
(def url "https://api.github.com/user/repos")
(def token (env :token))
(def headers {"Accept" "application/json" "Authorization" (str "Bearer " token)})
(def body "{'name:' 'test'}")
(curl/post url {:headers headers :body body})
I get back a 400 http status code. Any help appreciated!