Decoding binary objects in endpoint function arguments

Hey, folks!
I’m very new to MongoDB and network development so this might seem like an obvious one, but I’ve already spent more than enough time to resolve this, so here goes:

I have a MongoDB HTTP endpoint and the function backing it. When I make a request calling that endpoint, the backing function receives data in binary format.

What I cannot understand is how to access that data in the function. I suppose it should be decoded but I failed to find any specific information on how to do that, and I tried different approaches with no results.

Wow! 3 days and not single answer.
Is the subject is that complicated?