当我的客户端程序向www服务器发送了请求后,服务器会向客户端程序返回一些回应内容。
如向www.sohu.com发送请求后,会有如下一些内容。
HTTP/1.0 200 OK
Date: Wed, 12 Mar 2003 02:24:51 GMT
Server: Apache/1.3.26 (Unix) mod_gzip/1.3.19.1a
Vary: Accept-Encoding
Cache-Control: max-age=70
Expires: Wed, 12 Mar 2003 02:26:01 GMT
Last-Modified: Wed, 12 Mar 2003 02:24:51 GMT
ETag: W/"2cc75-19c15-3e6e9a7c"
Accept-Ranges: bytes
Content-Length: 105493
Content-Type: text/html
Age: 16
X-Cache: HIT from squid.sohu.com
Connection: close<html>
<!-- head -->
<head>
<title>搜狐首页</title>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<meta name="Create-time" content="2003-03-12 10:25:00">
<style type=text/css>
<!--
td,body,input,select {font-size: 12px;}
.white {font-size: 12px;color: #FFFFFF;text-decoration: none;}
.blue { text-decoration: underline;color:#000099;line-height: 18px;}
.blue1{ text-decoration: underline;color:#000099;line-height: 20px;}
a:hover {color: #cc0000;text-decoration: underline;}
a:active {color:#800080}
a.nav1 {font-size: 12px;color: #FFFFFF;text-decoration: none;}
a.nav1:hover {color: #FFEFA5;text-decoration: underline;}
a.nav1:active {color:#800080}
.finput {BORDER-RIGHT: 0px ridge;BORDER-TOP: 1px ridge #727272; BORDER-LEFT: 1px ridge #727272; BORDER-BOTTOM: 0px ridge;font-size: 12px;}
.foxinput {BORDER-RIGHT: 1px ridge; BORDER-TOP: #ffffff 1px ridge; BORDER-LEFT: #ffffff 1px ridge; BORDER-BOTTOM: 1px ridge; BACKGROUND-COLOR: #cccccc}
.black {color: #000000; text-decoration: none;line-height: 18px;}
.blue2 {line-height: 18px;color: #0033FF;text-decoration: underline;}
.blue3 {line-height: 18px;color: #0031FF;text-decoration: none;}
.blue4 {font-size: 12px;color: #0031FF;text-decoration: underline;}
.blue5 {text-decoration: underline;color:#000099;line-height: 19px;}
.blue6 {text-decoration: none;color:#000099;line-height: 19px;}
.blue7 {color: #0031FF;text-decoration: none;}
.blue8 {line-height: 18px;color: #000099;text-decoration: none;}
.nc {font-size: 12px;line-height: 18px;letter-spacing: 2px;}
//-->
</style>
</head><!-- end head -->
<!-- body -->
<body bgcolor=#FFFFFF vlink=#000099 leftmargin=0 topmargin=4>
<script src="./startlog.js"></script><!-- end body -->
<center>
<table width=760 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=632>
<!-- freemail -->
<table border=0 cellpadding=0 cellspacing=0>
但是令人奇怪的是,向www.sina.com.cn发送后,却回应了一堆乱码。如下:
HTTP/1.0 200 OK
Date: Wed, 12 Mar 2003 02:04:57 GMT
Server: Apache/2.0.43 (Unix)
Cache-Control: max-age=60
Expires: Wed, 12 Mar 2003 02:05:57 GMT
Last-Modified: Wed, 12 Mar 2003 01:58:11 GMT
Accept-Ranges: bytes
Content-Encoding: gzip
Vary: Accept-Encoding
Content-Length: 37193
Content-Type: text/html
X-Cache: HIT from gro37-1.sina.com.cn
X-Cache-Lookup: HIT from gro37-1.sina.com.cn:80
Connection: close?      斫鵺SG??^?囉顄1糮k?XY?鼿?t黜椬薑杁[ K?cLnk淣$捏<铣鍣&s萷閷刵 っz焆u??[矟慆緆Kgㄚ祂诪j邹?洘鲈驡斶?蕶隍p(^ (緞獯踋|嘢)9?>鑠('c裫艁逌肬夑镑7??鑧u0酳?墯说ス$???羂E齎殯^J罔錍娍??錘椕檵V蠳"?缴憽贆嶅置6?7鈮鷓P≈JYo$j凜B憵谀亁0?擶*衱~<t9x嗅t枵咪?擶p4v饂靽疄v笖W隆H0?Jt胳羙x?q篞膐溎u竭"帝搸B鉫G=N鄶Gc乣,??? + 咗鉆壇逖D"Zf89?媷蕔?暠hm$恛妗嬃X"澉咉}酨e?!/?D嵺? 紀%
TK-* h$k?H?恅.v %駂8牜?q晉J?@噤?瀻昞?葞煝
"?/嗏?謱牣B忀U澉|﨑鑒P籙QA/騕UQL屨?熭■奇*鬐c綝(9塅倗坛K ?40瞴I婪?A雒€f﹢o鰥奞6g*?8钚??銄?n
囲跬痂?徳?'h膝兂?鍡寷絚榺諵Fx4骆蝡4*a?w妫1緮齢??崌嶆 ?s0u吗鋊?ら?#/?!?R喾荒歎鏢?*ォA趴D?D痹i!苽a嬃C楏C栳褹?b愽C寘?阈_驎牵嶷D跅闎丏誂圦FN俘-腧P8敤?X
?Z坖蹜`濖蕂r斢'N?ㄘ!Z?/?u钤 ?T4晄/渁w摚??q隀g?:-垩犞?裨賁GO?u钕*錙焮??4舲b屔獒紝f?g膝?}﹂[璼!螆8(境佗=y波念P櫉鱼4佲??螜8(欜Ga焉?(.(畬A眐通爌堵A蓯a笌9鎟j牳M牑?)kQo姘峣 P?R觞盤MB ?暤臼`閥逧縁?4V遒P ?/鷅
翢?J???揝Q佖岶?v齾歚$?廁X葵擉娐袡?狿鳊中?龡?幤??灕暎?;缃D褲桁@n?v1X廩?r裩杠; B5鯐噧0╤槷?倄?q€眮R份~€硜Rg?w!接W冡xPj '瑐姩?鞠舳?5,叄昬褛蜿Pb邁吹噽z&}>骇T 圊j U€嘊憘犏Hmu罞_?x負?c?謿:銒请漳氪裗╞隭)-U鸰賰K?{ス??{$▓;D#スd}促獇A<??蚠?El| 鴸K困4#p纎苽壼XDI镍P鱻u钯C?茐椪?G齃5K刍跅赲?-?ńWA录M闳潤徏如ni&,V黫O瘵皘N裸臥崋?7湖廋沆mI儢t柩p鉚|禩赏U鲱e雌宽W變??翂e?t璘綻?KN暊锃蔲伩?3奔j X C妶?A?21拹蚾僛臋o麂;妉嚙ㄘQ'o唺b研烞4を&枣洧涚帨:}賑[?启SYMTp4?1\?~e鬤晱3{嵶这是为什么?是sina对回应内容加密了还是多字节的问题?