diff options
Diffstat (limited to 'src/clojure/contrib')
-rw-r--r-- | src/clojure/contrib/http/agent.clj | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/clojure/contrib/http/agent.clj b/src/clojure/contrib/http/agent.clj index 4fe30963..fe34c98c 100644 --- a/src/clojure/contrib/http/agent.clj +++ b/src/clojure/contrib/http/agent.clj @@ -50,13 +50,14 @@ (http-agent \"http...\" :method \"POST\" :body \"foo=1\") - And you could write the response directly to a file like this (requires - clojure.contrib.duck-streams/copy): + And you could write the response directly to a file like this: + + (require '[clojure.contrib.duck-streams :as d]) (http-agent \"http...\" :handler (fn [agnt] - (with-open [w (writer \"/tmp/out\")] - (copy (stream agnt) w)))) + (with-open [w (d/writer \"/tmp/out\")] + (d/copy (stream agnt) w)))) "} clojure.contrib.http.agent |