Best practices to send/ receive binary data (files)?

My custom app will be receiving files (images, pdf documents) and delivering files (pdf documents, zip files).

I am not sure how to map/ setup actions to send/ retrieve data. It would be quite easy to store the binary data base64 encoded into json, but I am not sure how other apps would handle that.

Is there some documentation in this regard?

The answer is: ask ChatGPT. It is basically the answer to most of my questions in the last days.