1.2.0 permalink Arrow_down_16x16
  • (string http-agnt)
  • (string http-agnt encoding)
Returns the HTTP response body as a string, using the given
encoding.

If no encoding is given, uses the encoding specified in the server
headers, or clojure.contrib.io/*default-encoding* if it is
not specified.

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:266 top

(defn string
  "Returns the HTTP response body as a string, using the given
  encoding.

  If no encoding is given, uses the encoding specified in the server
  headers, or clojure.contrib.io/*default-encoding* if it is
  not specified."
  ([http-agnt]
     (await http-agnt) ;; have to wait for Content-Encoding
     (string http-agnt (or (.getContentEncoding
                            ^HttpURLConnection (::connection @http-agnt))
                           duck/*default-encoding*)))
  ([http-agnt ^String encoding]
     (.toString (get-byte-buffer http-agnt) encoding)))
Vars in clojure.contrib.http.agent/string: await defn or deref
Used in 0 other vars

Comments top

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