One way of doing is to convert the binary data to Base64 and send it along with meta data as MediaType.APPLICATION_JSON
.
The problem with this is client has to convert the binary data into Base64 before sending.
I also tried sending using MediaType.APPLICATION_OCTET_STREAM
format through REST. This works fine for binary data only.
One option is to send meta data in headers while using MediaType.APPLICATION_OCTET_STREAM
.
Is there any better way?
Thanks