Skip to content

Instantly share code, notes, and snippets.

@neotyk
Created June 17, 2011 15:26
Show Gist options
  • Save neotyk/1031642 to your computer and use it in GitHub Desktop.
Save neotyk/1031642 to your computer and use it in GitHub Desktop.
http.async.client v0.3.0
(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))))
(http/with-client {:key val}
;; client usage
(let [resp (http/GET url)]
;; ..
))
(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