是否可以在Matlab的网络阅读中激活gzip支持? [英] Is it possible to activate gzip support in Matlab's webread?
本文介绍了是否可以在Matlab的网络阅读中激活gzip支持?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经嗅到webread
通过Internet发送的内容,发现它不使用任何gzip标头.这样就无法传输大的JSON和CSV文件.
I have sniffed what webread
sends over Internet and found that it doesn't use any gzip headers. This makes transferring of big JSON and CSV files impossible.
我可以通过某种方式激活gzip支持吗?
Can I activate gzip support somehow?
推荐答案
使用 webread 可以使用 weboptions 指定其他HTTP标头.
When using webread it is possible to specify additional HTTP headers with weboptions.
附加标头的语法:
options = weboptions('KeyName','Name','KeyValue','Value')
其中 Name 和 Value 分别是标题的名称及其值. 要启用 gzip ,您必须指定所需的HTTP标头.
Where Name and Value are the name of the header and its value respectively. To enable gzip, you must specify the required HTTP header.
options = weboptions('KeyName','Accept-Encoding','KeyValue','gzip')
然后您可以使用这些选项来执行您的请求.
You can then use the options to perform your request.
data = webread(url,options)
这篇关于是否可以在Matlab的网络阅读中激活gzip支持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文