我是网络编程的新手。
当我向服务器(在本例中为 google)发送 http 请求时,此回复:
HTTP/1.1 302 Found
Location: http://www.google.nl/?gws_rd=cr&ei=zXB_UumcEMiU4ASSqYG4Dg
Cache-Control: private Content-Type: text/html; charset=UTF-8
Set-Cookie: PREF=ID=0eb6ec4d3c54822b:FF=0:TM=1384083661:LM=1384083661:S=8KDjothF0RLKUwxF; expires=Tue, 10-Nov-2015 11:41:01 GMT; path=/; domain=.google.com
Set-Cookie: NID=67=ewT0so-Raq7uuSU_0DOqs08Ywb4EADK4kyGRnQesMqPx6DY23bHp4S5c9K2WbjCIFKe739Ya4L8VOcmBHm2QY9kR1sDH70L9jBU2XNJG3WrvtWiHH-uawg2Nli7mn1iK; expires=Mon, 12-May-2014 11:41:01 GMT; path=/; domain=.google.com; HttpOnly
P3P: CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info."
Date: Sun, 10 Nov 2013 11:41:01 GMT
Server: gws
Content-Length: 258
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Alternate-Protocol: 80:quic
我的请求:
HEAD / HTTP/1.1
Host: www.google.com
User-agent: HeadReqSample
我知道 302 代码意味着我得到了重定向,但我应该如何处理呢?如果我连接到其他服务器/网站(www.example.com),我会收到以下回复:
HTTP/1.1 200 OK
Accept-Ranges: bytes
Cache-Control: max-age=604800
Content-Type: text/html
Date: Sun, 10 Nov 2013 11:48:51 GMT
Etag: "359670651"
Expires: Sun, 17 Nov 2013 11:48:51 GMT
Last-Modified: Fri, 09 Aug 2013 23:54:35 GMT
Server: ECS (iad/1984)
X-Cache: HIT
x-ec-custom-error: 1
Content-Length: 1270
我应该怎么办?