An array byte compared to base 64 in a RESTful web service

My REST web service should send the image file to the client. I got confused in two ways: send the image as a byte array or should I encode it as a base 64 string? What are the pros and cons of each? I may have to compress the image using gzip ... should it create a problem with any of the methods? I might even need to set my method as a SOAP service, which method should I use in this case?

Thank!

+3
source share
2 answers

RESTful - HTTP. , "byte array" REST, HTTP GET URL REST . RESTful, . , base64 REST.

SOAP, base64. XML, SOAP. MTOM, SOAP- , , base64.

, . , .

+5

JSON XML ( + ), 64, , . , , .

GZip - (, tomcat - , gzip). - GZipFilter.

+1

Source: https://habr.com/ru/post/1789046/


All Articles