Created
June 17, 2011 15:26
-
-
Save neotyk/1031642 to your computer and use it in GitHub Desktop.
http.async.client v0.3.0
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
(ns explicit-client | |
(:require [http.async.client :as http])) | |
(with-open [client (http/create-client)] | |
(let [response (http/GET client "http://clojure.org")] | |
(println "status" (:code (http/status response))) | |
(println "body" (-> http/await http/string)))) |
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
(http/with-client {:key val} | |
;; client usage | |
(let [resp (http/GET url)] | |
;; .. | |
)) |
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
(with-open [client (http/create-client :key val)] | |
;; client usage | |
(let [resp (http/GET client url)] | |
;; .. | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment