The default HTTP agent result handler; it collects the response
body in a java.io.ByteArrayOutputStream, which can later be
retrieved with the 'stream', 'string', and 'bytes' functions.
(defn buffer-bytes
"The default HTTP agent result handler; it collects the response
body in a java.io.ByteArrayOutputStream, which can later be
retrieved with the 'stream', 'string', and 'bytes' functions."
[http-agnt]
(let [output (ByteArrayOutputStream.)]
(duck/copy (or (stream http-agnt) "") output)
output))
Comments top
No comments for buffer-bytes. Log in to add a comment.