Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Require duck-streams instead of using it. Works with Clojure 1.2.

Since they backed off on last-var-wins, duck-streams is unusable. Ick.
  • Loading branch information...
commit c65fa318d05033630b09f2a5edefd9eceddc3a2b 1 parent 093d00a
@technomancy technomancy authored
14 src/clojure_http/client.clj
@@ -1,6 +1,6 @@
(ns clojure-http.client
+ (:require [ :as duck])
(:use [ :only [as-str]]
- [ :only [read-lines spit]]
[clojure.contrib.str-utils :only [str-join]]
[clojure.contrib.base64 :as base64])
(:import ( URL
@@ -50,8 +50,8 @@ representation of argument, either a string or map."
(let [out (.getOutputStream connection)]
- (string? body) (spit out body)
- (map? body) (spit out (url-encode body))
+ (string? body) (duck/spit out body)
+ (map? body) (duck/spit out (url-encode body))
(instance? InputStream body)
(let [bytes (make-array Byte/TYPE *buffer-size*)]
(loop [#^InputStream stream body
@@ -74,10 +74,10 @@ url as its sole argument."
"Returns a lazy-seq of lines from either the input stream
or the error stream of connection, whichever is appropriate."
[#^HttpURLConnection connection]
- (read-lines (or (if (>= (.getResponseCode connection) 400)
- (.getErrorStream connection)
- (.getInputStream connection))
- (StringReader. ""))))
+ (duck/read-lines (or (if (>= (.getResponseCode connection) 400)
+ (.getErrorStream connection)
+ (.getInputStream connection))
+ (StringReader. ""))))
(defn- parse-headers
"Returns a map of the response headers from connection."
1  test/clojure_http/test/client.clj
@@ -1,4 +1,5 @@
(ns clojure-http.test.client
+ (:require [clojure-http.resourcefully])
(:use [clojure-http.client] :reload)
(:use [clojure.test]
[ :only [reader writer]]

0 comments on commit c65fa31

Please sign in to comment.
Something went wrong with that request. Please try again.