Skip to content

Instantly share code, notes, and snippets.

@weissjeffm
Created March 29, 2011 13:53
Show Gist options
  • Select an option

  • Save weissjeffm/892400 to your computer and use it in GitHub Desktop.

Select an option

Save weissjeffm/892400 to your computer and use it in GitHub Desktop.
How easy it is to use REST/json API in clojure :)
;;get all the names of the organizations
(->> (httpclient/get "http://f14-1.usersys.redhat.com:3000/api/organizations"
{:accept :json :basic-auth ["admin" "admin"]})
:body
json/read-json
(map #(-> :organization % :name)))
;; result
("admin" "auto-org-1301335937232" "test-dup-1301335953391" "env-test-org-1301335966901" "auto-org-1301338662907" "auto-org-1301342683415" "test-dup-1301342695388" "env-test-org-1301342706430" "auto-org-1301345619696" "test-dup-1301345637174" "env-test-org-1301345653178" "auto-org-1301367767981" "test-dup-1301367783022" "env-test-org-1301367797447")
Copy link

ghost commented Mar 29, 2011

nice ... awesome ... strange ... unusual :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment