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

Robust multipart/related support? #1

Open
paradox460 opened this issue Jan 17, 2015 · 2 comments
Open

Robust multipart/related support? #1

paradox460 opened this issue Jan 17, 2015 · 2 comments

Comments

@paradox460
Copy link

Duplicating the issue I opened on http (httprb/http#175), because it seems to be more relevant here:

Apologies if this already exists, but I haven't found any references to it.

Sometimes one needs to send data via multipart/related. This, so far, has been a huge pain in the ass, with almost every other ruby HTTP solution.

Comparatively, other libraries, such as Node.js' request make it downright simple. If we could get something similar to request's level of multipart/related support, it would be awesome. They not only solve the initial issue of crafting multiparts, but they go above and beyond and let you deal with some implementation caveats.

Thanks!

@Fryie
Copy link

Fryie commented Apr 12, 2015

I second the request, I had to use multipart/mixed recently and had to roll my own custom solution.

Ideally it would also be possible to add custom headers (like Content-Type and Content-Disposition) to body parts.

Maybe FormData is not the right place to do this, since this isn't strictly related to 'forms' anymore. I could imagine separating Multipart handling out as a gem and having FormData at a higher abstraction level. That is, one can use FormData for the 95% of the cases where the default use case is enough, and provide a lower-level Multipart class which just deals with concatening body parts correctly etc. and let the user add custom body parts with custom headers.

I don't really know all that much about HTTP, so I don't know if this made sense. :)

@ixti
Copy link
Member

ixti commented Apr 12, 2015

Well, initial idea of this gem was to just support emitting of multipart/form-data, but since very first release, I realized I would like it to provide a silver bullet for both emitting and parsing of request/response bodies of different types including www-urlencoded one. So I'm open for a Pull-Request (even a sketch will help a lot) as I don't have time right now to do this myself...

@ixti ixti mentioned this issue Jan 22, 2017
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

3 participants