//Generate your image byte [] image = image.getBytes(); responseProperties[0] = @{Content-Type" : "image/png" }" return bytes;
Thanks for the reply.Returning image as bytes and changing the "Content-Type" header sounds a good approach. To my understanding, for every REST operation, the client must specify the output format as say f=json or f=html or f=pjson and I believe the SOE REST request handler only support these three formats for now.So my concern is the requested output format can be either json/pjson/html even though my operation tries to send the image bytes with proper "Content-Type" header. Isn't it misleading?Correct me if I am missing something in here?
You could generate the image into a file and return it as bytes, and specifying a MIME type as "image/..." as the Content-Type.You could do: //Generate your image byte [] image = image.getBytes(); responseProperties[0] = @{Content-Type" : "image/png" }" return bytes;
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.