 (def ^:private api-version "v1.24")
 (def ^:private base-cmd ["curl" "--unix-socket" "/var/run/docker.sock" "-w" "%{http_code}"])
 
-(defn- parse-headers
-  "Parse headers map to curl vector cmd representation"
+(defn- map-headers
+  "Map request headers map to curl vector cmd representation"
   [headers]
   (->> headers
        (map #(str (name (key %)) ": " (val %)))

                      (parse-string (:err result) true))))))

(defn get
  ([api] (execute "GET" api nil nil))
  ([api headers] (execute "GET" api headers nil)))

(defn post
  ([api payload] (execute "POST" api nil payload))
  ([api headers payload] (execute "POST" api headers payload)))

(defn put
  ([api payload] (execute "PUT" api nil payload))
  ([api headers payload] (execute "PUT" api headers payload)))

(defn delete
  ([api] (execute "DELETE" api nil nil))
  ([api headers] (execute "DELETE" api headers nil)))
       (flatten)
       (into [])))

(defn- map-uri
  "Map request uri to curl vector cmd representation"
  [method uri]
  ["-X" method (str "http:/" api-version uri)])

(defn- map-payload
  "Map request payload to curl vector cmd representation"
  [json]
  (if (nil? json)
    []
