使用telnet进行http模拟请求。
telnet www.google.com 80Trying 64.233.189.99...Connected to www.l.google.com.Escape character is '^]'.GET /intl/en_ALL/images/logo.gif HTTP/1.1Host: www.google.comUser-Agent: Mozilla/5.0(Robots) Gecko/20061206 Firefox/1.5.0.9Accept-Encoding: gzip,deflateHTTP/1.1 200 OKContent-Type: image/gifLast-Modified: Wed, 07 Jun 2006 19:38:24 GMTExpires: Sun, 17 Jan 2038 19:14:07 GMTServer: gwsContent-Length: 8558Age: 13Date: Sun, 06 Apr 2008 06:51:56 GMTGIF89an..... |
telnet www.google.com 80Trying 64.233.189.104...Connected to www.l.google.com.Escape character is '^]'.GET /intl/en_ALL/images/logo.gif HTTP/1.1Host: www.google.comUser-Agent: Mozilla/5.0(Robots) Gecko/20061206 Firefox/1.5.0.9Accept-Encoding: gzip,deflateIf-Modified-Since: Wed, 07 Jun 2006 19:38:24 GMTHTTP/1.1 304 Not ModifiedDate: Sun, 06 Apr 2008 06:53:10 GMTServer: GFE/1.3 |
telnet l.yimg.com 80Trying 203.209.246.249...Connected to geoycs-l.yahoo8.akadns.net.Escape character is '^]'.GET /a/i/ww/news/2008/04/04/crocodile-sm.jpg HTTP/1.1Host: l.yimg.comUser-Agent: Mozilla/5.0(Robots) Gecko/20061206 Firefox/1.5.0.9Accept-Encoding: gzip,deflateConnection: keep-aliveHTTP/1.1 200 OKDate: Sat, 05 Apr 2008 00:14:27 GMTCache-Control: max-age=315360000Expires: Tue, 03 Apr 2018 00:14:27 GMTLast-Modified: Fri, 04 Apr 2008 17:49:26 GMTAccept-Ranges: bytesContent-Length: 860Content-Type: image/jpegAge: 133250Connection: keep-aliveServer: YTS/1.16.0Connection closed by foreign host. |
In HTTP/1.1 the ETag and If-None-Match headers are another way to make conditional GET requests.
<img alt="red star" src="data:image/gif;base64,R0lGODlhDAAMALMLAPN8ffBiYvWWlvrKy/FvcPewsO9VVfajo+w6O/zl5estLv/8/AAAAAAAAAAAAAAAACH5BAEAAAsALAAAAAAMAAwAAAQzcElZyryTEHyTUgknHd9xGV+qKsYirKkwDYiKDBiatt2H1KBLQRFIJAIKywRgmhwAIlEEADs="> |