3 ms·
This reminds me of a quite popular mobile game that sends master game data using messagepack which is then gzipped and then encrypted and then base64 encoded in
by squaresmile 7y ago
This reminds me of a quite popular mobile game that sends master game data using messagepack which is then gzipped and then encrypted and then base64 encoded in a json response. Fun.
- twic 7y agoI once used an API where to send a command, you would make a POST where the message body was an x-www-form-urlencoded dictionary where one of the values is a binary string which is a zipped XML document. It was very clearly just a page on the vendor's site where you could manually upload a zip of documents, which they had simply declared to be an API.
- dwild 7y agoThat remind me of one of my first contracts, 10 years ago, for an Android mobile app. It was an app made to quickly record something using video, audio or picture, that would then be uploaded through their API. The API worked essentially like you said, it was converting the binary file to base64, adding it to a JSON, which was in a GET variable (thus urlencoded) and sending that over an HTTP connection (I don't remember if it was HTTPS or not though, I hope it was, but at the time I could have ignored that part). Android didn't allowed more than 16 MB of memory for an app, thus I had to build streams to support each things individually, that was an interesting challenge. I was amazed to find out that there was officially supported Base64 streams, but their API strangely didn't accept the default Base64, it was only accepting the one for URL (which replace a few characters with others one), so I had to add another stream on top to do this.