Skip to content

Unable to access raw body stream from fetch response #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
knubie opened this issue Apr 12, 2024 · 1 comment
Open

Unable to access raw body stream from fetch response #26

knubie opened this issue Apr 12, 2024 · 1 comment

Comments

@knubie
Copy link

knubie commented Apr 12, 2024

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)]

@plexus
Copy link
Member

plexus commented Apr 13, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants