使用POST参数压缩HTTP的文本 [英] Compressing text for HTTP with POST parameters

查看:596
本文介绍了使用POST参数压缩HTTP的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写的客户端软件启动了一个带有大量文本(实际上是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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆