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 additional Request.body formats #1147

Open
thescientist13 opened this issue Aug 26, 2023 · 0 comments
Open

support additional Request.body formats #1147

thescientist13 opened this issue Aug 26, 2023 · 0 comments
Labels
feature New feature or request
Milestone

Comments

@thescientist13
Copy link
Member

thescientist13 commented Aug 26, 2023

Type of Change

Feature

Summary

Coming out of #1132 , while we were able to support all the options for a Response constructor options, we were not able to do so for Request, but also, for Request.body specifically, a number of options were not validated. We definitely have support for

  1. .text()
  2. .json() (application/json)
  3. .formData() (only supports application/x-www-url-encoded at this time)

So this is a tracking issue to make sure we revist these and test / support them where applicable

Details

Addition options we would like to support both from front end and back end:

  1. .formData() (multipart/form-data / file uploads)
  2. URLSearchParams
  3. ReadableStream
  4. Blob / blob()
  5. ArrayBuffer / arrayBuffer()
  6. TypedArray
  7. DataView

I think most of this may be limited by what is actually possible over HTTP in the first place.


It should be noted that part of the struggle is due to Koa not being able to provide a fully formed Request object by default, as well as for development, having to use Workers (which can only support string data structures) to do cache busting like for API routes.

So I think this could / should be all done comprehensively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant