Skip to content
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

Support for binary content #6

Closed
keroami opened this issue Mar 5, 2024 · 2 comments
Closed

Support for binary content #6

keroami opened this issue Mar 5, 2024 · 2 comments

Comments

@keroami
Copy link

keroami commented Mar 5, 2024

3rd party provides me with large gzip'ed json.

Add

@external(javascript, "../ffi.mjs", "read_body")
pub fn read_body(
  a: Response(FetchBody),
) -> Promise(Result(Response(BitArray), FetchError))

which the user must gunzip afterwards?

If so, I have a PR.

@lpil
Copy link
Member

lpil commented Mar 5, 2024

Good idea! Let's call it read_bytes_body.

@keroami
Copy link
Author

keroami commented Mar 6, 2024

I built it all, only to realize I didn't use it - the download mechanism of the run-time (now, at least) takes the 'encoding: gzip' and gunzips for me, yielding a String.

Nevertheless, there could be other binary downloads (images, zip files) that would need this.

@keroami keroami changed the title Support for gzip'ed content Support for binary content Mar 6, 2024
@lpil lpil closed this as completed Mar 7, 2024
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