On Tue, 20 Aug 2013 02:22:09 GMT, Dicebot wrote:

I need to warn that this is a very delicate thing if you consider REST interface client. Currently you are guaranteed to have 100% working client-server pair if those use same interface definition. If application will be allowed to use custom serialization format not deducible from interface definition, this guarantee will perish and manual parsing will be needed at client, as well as integrity control.

This is quite a feature to lose.

(Asumming you mean the OutputStream suggestion:) Think of it as a single ubyte[] return value. What's stored inside that array is up to the API implementor and using an OutputStream doesn't make a difference there. The wire protocol will still be well-defined, but just use binary data instead of JSON in that case. I think it's actually a quite common requirement to be able to transfer raw file contents (not necessarily from an actual file, tough). So at least we should find some solution here.