require 'open-uri'
require "zlib"
uri='http://api.jijinhao.com/realtime/quotejs.htm?codes=JO_61810%2CJO_61813%2CJO_9754%2CJO_9753%2CJO_38493%2CJO_38496%2CJO_42757%2CJO_111%2CJO_9833¤tPage=1&pageSize=6&_=1446945228687'
data=open(uri, 'Accept' => '*/*',
'Accept-Encoding' => 'gzip,deflate',
'Accept-Language' => 'en-US,en:q=0.5',
"User-Agent" => "Mozilla/5.0 (Windows NT 6.1; rv:25.7) Gecko/20151012 Firefox/31.9 PaleMoon/25.7.3",
'Host'=>'api.jijinhao.com',
'Referer' => 'http://www.cngold.org/gold_td/',
'Connection'=>'keep-alive').read()
#puts f.read
data_compressed = Zlib::Inflate.inflate(data)
puts data_compressed
解压 gzip 报错 n `inflate': incorrect header check (Zlib::DataError)