I have a client that will send large JSON files to the API server. Since the files are so compressible, I would like to gzip them and send the compressed data.
What I would like to know: what is the best way to signal my server intent?
Basically, I want the opposite side of Accept-encoding , so that the server will process the data as compressed only for transport purposes and automatically decompress the data before interpreting it according to the Content-Type .
This means that I cannot set the Content-Type field to application/gzip , because the server must have application/json to understand what true uncompressed data encoding is.
Content-Transfer-Encoding looks like it will serve my purpose, but it was created with email in mind and only supports 7bit , quoted-printable , base64 , 8bit and binary .
Is there transparent compression / decompression for HTTP transport from client to server? And if not, what are the best practices for what I'm trying to achieve?
source share