I’m constructing a REST service accepting Foo objects containing a mix of String and binary data. This is the XML I got so far.
<foo>
<text>regular text</text>
<text mime="application/octet-stream">base64 encododed binary data</text>
</foo>
Is this a good idea or are there drawbacks inlining large amounts (MBs) of binary data?
As a minor design detail, I’m trying to settle between using <text mime=".."/> or a dedicated name <binary>...</binary> for the binary data. Which would be more coherent?
I would recommend including in your request/response xml’s only the location where you will store the binary data you want to pass and then retrieve that data executing another request.
The cons of that solution would be to execute another request but the pros are on your side: