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

Implement Request/Response .bytes() method #11049

Closed
bakkot opened this issue May 13, 2024 · 2 comments · Fixed by #11104
Closed

Implement Request/Response .bytes() method #11049

bakkot opened this issue May 13, 2024 · 2 comments · Fixed by #11104
Assignees
Labels
enhancement New feature or request web-api Something that relates to a standard Web API

Comments

@bakkot
Copy link
Contributor

bakkot commented May 13, 2024

See whatwg/fetch#1732.

Tests at web-platform-tests/wpt#46198.

The above spec PR adds a bytes() method to get a Uint8Array to Body, instead of requiring users to get an ArrayBuffer with arrayBuffer() and then wrap it.

There are also PRs to do the same for Blob and PushMessageData, which copy relevant parts of the Body interface:

I don't think Bun has PushMessageData but it does have Blob.

@Electroid Electroid added enhancement New feature or request web-api Something that relates to a standard Web API labels May 13, 2024
@Jarred-Sumner
Copy link
Collaborator

Sounds great. We will add this.

@bakkot
Copy link
Contributor Author

bakkot commented May 14, 2024

You may be interested in the WebKit PR for the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request web-api Something that relates to a standard Web API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants