1.2.0 permalink Arrow_down_16x16
  • (stream http-agnt)
Returns an InputStream of the HTTP response body. When called by
the handler function passed to http-agent, this is the raw
HttpURLConnection stream.

If the default handler function was used, this function returns a
ByteArrayInputStream on the buffered response body.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/http/agent.clj:246 top

(defn stream
  "Returns an InputStream of the HTTP response body.  When called by
  the handler function passed to http-agent, this is the raw
  HttpURLConnection stream.

  If the default handler function was used, this function returns a
  ByteArrayInputStream on the buffered response body."
  [http-agnt]
  (let [a @http-agnt]
    (if (= (::state a) ::receiving)
      (::response-stream a)
      (ByteArrayInputStream.
       (.toByteArray (get-byte-buffer http-agnt))))))
Vars in clojure.contrib.http.agent/stream: = defn let
Used in 0 other vars

Comments top

No comments for stream. Log in to add a comment.