diff options
author | 2023-07-19 23:12:06 -0700 | |
---|---|---|
committer | 2023-07-19 23:12:06 -0700 | |
commit | dd46c11273211601bb67eff04dde7279fff5b8d5 (patch) | |
tree | 4251aa7cd12af02a471cad311239c5c86b3613ed /docs | |
parent | 8a13e024734f1571e294a72f5a0ab2835eac4b8f (diff) | |
download | bun-dd46c11273211601bb67eff04dde7279fff5b8d5.tar.gz bun-dd46c11273211601bb67eff04dde7279fff5b8d5.tar.zst bun-dd46c11273211601bb67eff04dde7279fff5b8d5.zip |
Support streams in response.formData() & request.formData, introduce Bun.readableStreamToFormData() (#3697)
* codegen
* FormData.from
* Fixes #3225
* Introduce `Bun.readableStreamToFormData`
* Update bun.d.ts
* Add examples
* add
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/api/utils.md | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/api/utils.md b/docs/api/utils.md index 24cb94ed2..7366649b7 100644 --- a/docs/api/utils.md +++ b/docs/api/utils.md @@ -460,6 +460,12 @@ await Bun.readableStreamToText(stream); // returns all chunks as an array await Bun.readableStreamToArray(stream); // => unknown[] + +// returns all chunks as a FormData object (encoded as x-www-form-urlencoded) +await Bun.readableStreamToFormData(stream); + +// returns all chunks as a FormData object (encoded as multipart/form-data) +await Bun.readableStreamToFormData(stream, multipartFormBoundary); ``` ## `Bun.resolveSync()` |