 (ns clj-http.core
   "Core HTTP request/response implementation."
   (:require [clojure.pprint])
-  (:import (java.net URI)
+  (:import (java.io File InputStream)
+           (java.net URI)
            (org.apache.http HttpRequest HttpEntityEnclosingRequest
                             HttpResponse Header HttpHost)
            (org.apache.http.util EntityUtils)
            (org.apache.http.entity ByteArrayEntity)
            (org.apache.http.entity.mime MultipartEntity)
-           (org.apache.http.entity.mime.content ByteArrayBody)
+           (org.apache.http.entity.mime.content ByteArrayBody
+                                                FileBody
+                                                InputStreamBody
+                                                StringBody)
            (org.apache.http.client HttpClient)
            (org.apache.http.client.methods HttpGet HttpHead HttpPut
                                            HttpPost HttpDelete

  (if insecure?
    (SingleClientConnManager. insecure-scheme-registry)
    (SingleClientConnManager.)))

(defn request
  "Executes the HTTP request corresponding to the given Ring request map and

          (let [mp-entity (MultipartEntity.)]
            (doseq [[k v] multipart]
              (.addPart mp-entity (name k) (ByteArrayBody. v (name k))))
            (.setEntity #^HttpEntityEnclosingRequest http-req
                        (create-multipart-entity multipart)))
          (when body
            (let [http-body (ByteArrayEntity. body)]
              (.setEntity #^HttpEntityEnclosingRequest http-req http-body))))
