我正在尝试保存使用clj-http下载的文件
我有以下代码:
(def test-file
(cl/get "http://placehold.it/350x150"))
(defn write-file []
(with-open [w (clojure.java.io/writer "test-file.gif" :append true)]
(.write w (:body test-file))))
当我尝试将其作为字节数组时,出现异常:
user=> (def test-file
(cl/get "http://placehold.it/350x150" {:as :byte-array}))
#'user/test-file
user=> (write-file)
IllegalArgumentException No matching method found: write for class java.io.BufferedWriter clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:79)
帮助!