putting a image as output of a rest service microflow

0
I have a image that i want to sent back to the consumer of my service. In the microflow i retrieve the image (i see that it has contents when i inspect it) I assign the received image to the output variable of my microflow (the ouput inherits from System.image). When i test the service i receive a content length of 0 As contenttype i get Content-Type → application/octet-stream;charset=UTF-8 which seems ok. Is there any idea why this can go wrong.
asked
2 answers
0

Did you base64 encode the image? The java action for this is in the community commons module.

Regards,

Ronald

answered
0

For one specific case we return an ID to the consumer which in turn can be used to down the binary document via a custom request handler (Java coded). I tried to use DeepLink for that, but the consumer could not handle the crap that DeepLink sends along, hence the clean download via the request handler.

So it is a 2-step proces:

  1. REST call which returns a download ID
  2. Construct the download URL, call it and that returns the binary document
answered