Created
March 29, 2011 13:53
-
-
Save weissjeffm/892400 to your computer and use it in GitHub Desktop.
How easy it is to use REST/json API in clojure :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;;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") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nice ... awesome ... strange ... unusual :)