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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: multipart accepting form data #29574

Closed
NikkTod opened this issue Feb 20, 2024 · 3 comments
Closed

[Feature]: multipart accepting form data #29574

NikkTod opened this issue Feb 20, 2024 · 3 comments

Comments

@NikkTod
Copy link

NikkTod commented Feb 20, 2024

馃殌 Feature Request

Hello,

Use case:
Back-end Glue API service accepts multiple files with same field name 'attachment'

POST https://host:post/v1/email

--WebAppBoundary
Content-Disposition: form-data; name="email"; Content-Type: application/json

--WebAppBoundary
Content-Disposition: form-data; name="attachment"; filename="file1.pdf" Content-Type: application/octet-stream

--WebAppBoundary
Content-Disposition: form-data; name="attachment"; filename="file2.csv" Content-Type: application/octet-stream

Trying to send multiple files with following code, but multipart does not accept form data:

const formData = new FormData();
formData.append('email', {Json Payload});
formData.append('attachment', fs.createReadStream('file1.pdf'));
formData.append('attachment', fs.createReadStream('file2.csv'));

response = await request.post("https://host:post/v1/email", {
headers: setToken(),
multipart: formData
});

I saw Java language port supports that, but what about JS/TS ?

image

Example

No response

Motivation

Supporting multiple file attachments (email API) when that API accepts form fields with the same name.

@mxschmitt
Copy link
Member

Looks like a duplicate of #28070

@NikkTod
Copy link
Author

NikkTod commented Feb 20, 2024

Yep, looks similar, is there some workaround 馃檹

@mxschmitt
Copy link
Member

mxschmitt commented Feb 20, 2024

Unfortunately not as of today. Folding into it by that.

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