Is it possible to activate gzip support in Matlab's webread?

≡放荡痞女 提交于 2019-12-24 08:45:47

问题


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.

Can I activate gzip support somehow?


回答1:


When using webread it is possible to specify additional HTTP headers with weboptions.

The syntax for an additional header:

options = weboptions('KeyName','Name','KeyValue','Value')

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)


来源:https://stackoverflow.com/questions/50457391/is-it-possible-to-activate-gzip-support-in-matlabs-webread

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!