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

Consider support for "multipart" requests #209

Closed
jmdacruz opened this issue Jun 9, 2015 · 3 comments
Closed

Consider support for "multipart" requests #209

jmdacruz opened this issue Jun 9, 2015 · 3 comments

Comments

@jmdacruz
Copy link

jmdacruz commented Jun 9, 2015

I think this is really a stretch, but we recently ran into this situation and I think it's worthwhile mentioning: Imagine a situation in which you want to POST a binary file (e.g., image) which has metadata associated to it (e.g., image properties not in EXIF such as image description).

One of the ways of doing this is with a multipart POST request, one that has a JSON part (for the metadata of the image) and a binary part (for the image itself). This is possible with the current blueprint spec: you can set the Content-Type via "Request" to 'multipart/form-data;boundary="-----some-boundary-----"', and then just craft the body manually with the selected boundary and with each of the sections/parts having its own set of headers.

The problem with this, I think, is that you can't use MSON inside one of these parts, because you are already "inlining" the resource representation into the "Body" section.

Again, I don't see this is a must-have since there are other alternatives such as separating the metadata creation and the binary upload into two different operations (e.g., first create metadata and then upload binary using handle/token from POST result), but it was worth mentioning.

@zdne
Copy link
Contributor

zdne commented Jun 10, 2015

@jmdacruz interesting. If I understand it correctly you suggest an improvement where each (some) part(s) of a multipart message has its own MSON attributes. Correct?

If so please look at the issue #100 – and #100 (comment) in particular? Would having attributes under part section work?

@jmdacruz
Copy link
Author

Yes, that would definite work. I also agree with some of the comments on the thread in that some of the attributes of each part could be abstracted away (e.g., the boundary could be defined for the entire message or even randomized)

@zdne
Copy link
Contributor

zdne commented Jun 22, 2015

also agree with some of the comments on the thread in that some of the attributes of each part could be abstracted away

@jmdacruz we best to add these comments there to bump it and make sure it won't get forgotten.

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