使用POST参数压缩HTTP的文本 [英] Compressing text for HTTP with POST parameters
问题描述
我编写的客户端软件启动了一个带有大量文本(实际上是JSON对象)作为POST参数的HTTP请求。我想在发送和解压缩服务器上的文本之前压缩这个文本。
Gzip生成二进制,我不能作为POST参数发送,我想。 / p>
哪些选项/算法可以压缩文本并将其发送到网络服务器?
编辑:一个选项GZIP然后BASE64编码二进制数据?
为什么你不使用标准 HTTP gzip compression ?
)
更新:
Ah yes - 我的错。那么为什么不简单地gzip这个文件,将它上传到服务器,就像一个multipart / form-data文件上传,然后un-gzip它在服务器上?
I am writing client software that initiates a HTTP request with a large blob of text (JSON object actually) as POST parameter. I want to compress this text before sending and decompress the text on the server.
Gzip produces binary, which I can't send as a POST parameter, I think.
Which options/algorithms exist to compress text and send it to a web server?
Edit: Would it be an option to GZIP and then BASE64 encode the binary data?
Why don't you just use the standard HTTP gzip compression?
(It just seems a bit mad to needlessly re-invent the wheel.)
Update
Ah yes - my bad. So why not simply gzip the file, upload it to the server as you would a multipart/form-data file upload and then un-gzip it on the server?
这篇关于使用POST参数压缩HTTP的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!