Using ServiceStack to Download Image Files

We have a requirement to download images using the ServiceStack API.

I know two possible ways:

1) Use a JSON object to load the file (using the BASE64 line). 2) Use "multipart / form-data"

Is there any other way to upload files using ServiceStack? Which is best in terms of best practices?

+6
source share
1 answer

The best way to upload files to ServiceStack is to simply perform a normal HTTP file upload to see the source code for imgur.servicestack.net or upload files to RestFiles .

If you do not want to send multipart/form-data , use a binary format, for example, Protocol buffer support in ServiceStack , and send byte[] to avoid the computational and payload overhead of encoding binary files in text format.

+11
source

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


All Articles