lambdaisland/fetch

Unable to access raw body stream from fetch response

Opened this issue · 1 comments

In js/fetch you can access the raw body as a stream like so:

(let [res (<p! (js/fetch endpoint #js{...}))]
  (-> res .-body (.pipe dest)))

However, similar to #25, in lambdaisland/fetch it's not possible to access the raw body because it's always decoded first.

(p/let [body (decode-body content-type response opts)]

decode-body is a multimethod, we should add a no-op :raw option, so you can make a request :as :raw. A pr for that would be welcome.