http请求,返回非中文乱码问题案例

问题:发送http请求,返回了一段乱码.
原因:发送请求的消息头中,设置有accept-encoding: gzip, deflate
如果被访问的tomcat中,设置了,<Connector port="80" protocol="HTTP/1.1"   
           connectionTimeout="20000"   
           redirectPort="8443" executor="tomcatThreadPool" URIEncoding="utf-8"   
                      compression="on"   
                       compressionMinSize="50" noCompressionUserAgents="gozilla, traviata"   
                       compressableMimeType="text/html,text/xml,text/javascript,text/css,text/plain"
/>  则标识为,该请求的消息体,超过设置大小,则会进行gzip压缩返回

你可能感兴趣的:(tomcat)