How to design XML Restful service interface for file uploading?
We have some XML restful services implemented in MVC (C#). Their overall look and feel is very similar to http://www.zendesk.com/api.
Now we need to accept some files uploaded.
The services are intended for consumption from PHP / Python / ruby and other popular web development languages.
How should we do it right? multipart/form-data? or just read post body?
I'm concerned about the开发者_如何学运维 ease of use from mentioned languages and popular web development frameworks. Unfortunately, i don't have anyone to ask on consumer side.
I'm also concerned about memory consumption. As i understand, multipart/form-data will be converted by MVC / ASP.NET to HttpPostedFileClass which caches itself on the web server disk. But plain POST won't, so it will consume IIS memory?
Maybe there are other notable options to consider? What do you think?
It is REST! So forget about XML. Use the native opportunities of the web. Write a stream to the service would be in the end the fastest and easiest too.
精彩评论