Skip to content

How to Fetch Binary Data

Terje Norderhaug edited this page May 15, 2019 · 4 revisions

To fetch binary data, add :response-type :array-buffer to the request options:

(get "https://clojurescript.org/images/cljs-logo-120b.png" {:response-type :array-buffer})

Calling get will by default return a string. If the resource is binary, the resulting string will likely appear mangled, with unrecognized characters replaced by � which is the Unicode 'REPLACEMENT CHARACTER' (U+FFFD).

Clone this wiki locally