Returns a map of HTTP response headers. Header names are converted
to keywords in all lower-case Header values are strings. If a
header appears more than once, only the last value is returned.
(defn headers
"Returns a map of HTTP response headers. Header names are converted
to keywords in all lower-case Header values are strings. If a
header appears more than once, only the last value is returned."
[http-agnt]
(reduce (fn [m [^String k v]]
(assoc m (when k (keyword (.toLowerCase k))) (last v)))
{} (.getHeaderFields
^HttpURLConnection (::connection @http-agnt))))
Comments top
No comments for headers. Log in to add a comment.