[Seaside] Re: [Seaside-dev] multipart/related any experience?
norbert at hartl.name
Mon Oct 11 17:36:20 UTC 2010
On 11.10.2010, at 06:49, Philippe Marschall wrote:
> 2010/10/10 Norbert Hartl <norbert at hartl.name>:
>> At the moment I'm creating a rest interface to my application. Since now we are using multipart/form-data but for creating single resource I have the feeling it is less appropriate. Searching the web there is less to find about the application of multipart/related messages. And the request parsing I can find around seaside doesn't reflect this mime-type either.
>> I didn't even find tools that are capable of sending requests with this mime-type. So has anyone of you experience in using/processing this?
> Uhm, this is fairly uncommon. Shipping a full HTML document which
> pictures and everything is about the only use case that comes to my
> mind. What's your reasoning for choosing multipart/related over more
> common ones (application/xml, application/json)? What is your
> client(s) going to be?
The main client at the moment is the iphone. One of the prominent use cases is to take a picture, enter some data and upload it to the server. The data format will be XML. My gut feeling tells me that if you create an object of type foo with an image attached a proper way would be to do a post request to /foo/ with multipart/related having the XML in the main body and images/files as the multipart related parts.
At the moment I'm doing it with multipart/form-data but then you even need a parameter name for the XML part. Even it is not a big difference it is enough for me to care if there is a proper solution to it.
More information about the seaside