REST service and large files

Can a REST web service (which usually produces, for example, simple JSONs ) process and return large binary I / O data?

I mean, call the REST service over HTTP POST, providing a large file, and then read the large result? Is REST ok for this? ("Large" = several megabytes)

+4
source share
3 answers

With text serializers such as JSON and XML, you get about a 33% increase in file size over the wire, since binary data must be encoded in Base64. There are more optimized protocols such as MTOM to handle this scenario. WCF supports MTOM out of the box.

+3
source

REST architectures are quite capable of using HTTP to serve application/octet-stream , which is just a stream of bytes. HTTP can quite reliably serve very large files.

+3
source

Because REST is primarily a service through HTTP, standard HTTP requirements and restrictions apply to REST services. You can send large files with several MB as POST to the REST API so that one uploads a large file to the web application.

+2
source

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


All Articles