I am making a GET request using clj-http and the response is a zip file. The contents of this zip are always one CSV file. I want to save a CSV file to disk, but I cannot figure out how to do this.
If I have a file on disk, (fs/unzip filename destination)the Raynes / fs library works fine, but I can't figure out how I can force the clj-http response to something that it can read. If possible, I would like to unzip the file directly without
The closest I got (if it's even close) leads me to a BufferedInputStream, but I got lost from there.
(require '[clj-http.client :as client])
(require '[clojure.java.io :as io])
(->
(client/get "http://localhost:8000/blah.zip" {:as :byte-array})
(:body)
(io/input-stream))
source
share