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 multipart/form-data Content-Type in HTTP response #1704

Open
vmaffione opened this issue Nov 4, 2023 · 4 comments
Open

Support for multipart/form-data Content-Type in HTTP response #1704

vmaffione opened this issue Nov 4, 2023 · 4 comments

Comments

@vmaffione
Copy link
Contributor

Hi,
As far as I can see support for multipart/form-data is only available for HTTP requests (both for the client and server side).

Any opinion/plans about adding client and server support also for HTTP responses? This would be handy for all those cases where a HTTP server needs to "atomically" return one or more files (application/octet-stream) along with associated metadata (e.g. JSON, XML), without resorting to encoding the files, e.g. as BASE64 within a JSON field, since this latter solution bloats the response and adds considerable processing and memory overhead...

Thanks

@yhirose
Copy link
Owner

yhirose commented Nov 20, 2023

@vmaffione thanks for the feature request. I don't have time to implement it for now, but I keep it with the 'enhancement' label.

@vmaffione
Copy link
Contributor Author

Sure, but so do you think it would make sense to implement something like this?
I am still not sure the HTTP standard allows to use such a content-type within a response...

@yhirose
Copy link
Owner

yhirose commented Nov 20, 2023

I haven't investigated if it's possible to implement the feature, yet. Do you know any HTTP libraries which support such a feature? If so, I'll take a look at how those libraries implement it. I personally don't need it on my projects at this point though.

@vmaffione
Copy link
Contributor Author

To be honest, I only found this stack overflow discussion
https://stackoverflow.com/questions/47067312/multipart-http-response
mentioning that it is possible to achieve that with Node.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants