Professional Documents
Culture Documents
2010.06.22
.................................................................................................................................................................... 3
HTTP URL ........................................................................................................................... 3
HTTP ........................................................................................................................... 3
HTTP ........................................................................................................................... 4
HTTP ................................................................................................................... 5
1.............................................................................................................................................. 5
2.............................................................................................................................................. 6
3.............................................................................................................................................. 7
4.............................................................................................................................................. 7
telnet http .................................................................................................8
1 telnet......................................................................................................................................... 8
2...................................................................................................................... 9
3.......................................................................................................................................... 9
4............................................................................................................................................ 10
HTTP ......................................................................................................................... 10
1.................................................................................................................................................... 10
2HTTP ................................................................................ 11
3HTTP Content Lenth ................................................................ 11
4 HTTP ................................................................... 11
5Http ........................................................................................................................... 11
6.................................................................................................................................................... 12
HTTP
HTTP
1990
WWW HTTP/1.0
HTTP/1.1 HTTP-NG(Next Generation of HTTP)
HTTP
1./
2. GETHEAD
POST HTTP HTTP
3.HTTP Content-Type
4.
5.HTTP
HTTP URL
HTTP
http TCP
HTTP1.1 Web HTTP
Web
HTTP URL (URL URI)
http://host[":"port][abs_path]
http HTTP host Internet IP
port 80abs_path URI URL
abs_path URI /
eg:
1www.guet.edu.cn
http://www.guet.edu.cn/
2http:192.168.0.116:8080/index.jsp
HTTP
HTTP
http
1 URI Method
Request-URI HTTP-Version CRLF
Method Request-URI HTTP-Version
HTTP CRLF CRLF CR LF
GET
Request-URI
POST
Request-URI
HEAD
Request-URI
PUT
Request-URI
DELETE Request-URI
TRACE
CONNECT
OPTIONS
GET GET
eg:GET /form.html HTTP/1.1 (CRLF)
POST
egPOST /reg.jsp HTTP/ (CRLF)
Accept:image/gif,image/x-xbit,... (CRLF)
...
HOST:www.guet.edu.cn (CRLF)
Content-Length:22 (CRLF)
Connection:Keep-Alive (CRLF)
Cache-Control:no-cache (CRLF)
(CRLF)
// CRLF
user=jeffrey&pwd=1234 //
HEAD GET HEAD HTTP
GET
Request-URI
2
3()
HTTP
HTTP
HTTP
HTTP
1
HTTP-Version Status-Code Reason-Phrase CRLF
HTTP-Version HTTP Status-Code
Reason-Phrase
1xx--
2xx--
3xx--
4xx--
5xx--
200 OK
//
400 Bad Request //
401 Unauthorized // WWW-Authenticate
//
403 Forbidden //
404 Not Found //eg URL
500 Internal Server Error //
503 Server Unavailable
//
//
egHTTP/1.1 200 OK CRLF
2
3
HTTP
HTTP
HTTP
CRLF
HTTP
+++
eg
Cache-Control
HTTP1.0
Pragma
no-cacheno-storemax-age
max-stalemin-freshonly-if-cached;
Accept
Accept egAcceptimage/gif
GIF Accepttext/html html
Accept-Charset
Accept-Charset eg
Accept-Charset:iso-8859-1,gb2312.
Accept-Encoding
Accept-Encoding Accept eg
Accept-Encoding:gzip.deflate.
Accept-Language
Accept-Language Accept eg
Accept-Language:zh-cn.
Authorization
Authorization
401 Authorization
Host
Host Internet HTTP URL
eg
http://www.guet.edu.cn/index.html
Host
Hostwww.guet.edu.cn
80Hostwww.guet.edu.cn:
User-Agent
User-Agent
User-Agent
User-Agent
3
Request-URI
Location
Location Location
Server
Server User-Agent
Server
ServerApache-Coyote/1.1
WWW-Authenticate
WWW-Authenticate 401 401
Authorization
egWWW-Authenticate:Basic realm="Basic Auth Test!" //
eg
Content-Encoding
Content-Encoding
Content-Type
Content-Encoding egContent-Encodinggzip
Content-Language
Content-Language
egContent-Language:da
Content-Length
Content-Length
Content-Type
Content-Type eg
Content-Type:text/html;charset=ISO-8859-1
Content-Type:text/html;charset=GB2312
Last-Modified
Last-Modified
Expires
Expires
()
Expires egExpiresThu15 Sep 2006 16:23:12
GMT
HTTP1.1 0eg
Expires 0 jsp
response.setDateHeader("Expires","0");
telnet http
MS telnet http
telnet http
1 telnet
1.1 telnet
-->cmd-->telnet
1.2 telnet
set localecho
2
2.1 open www.guet.edu.cn 80
//
//
// telnet www.sina.com.cn
80
HEAD /index.asp HTTP/1.0
Host:www.sina.com.cn
3
3.1 2.1 :
HTTP/1.1 200 OK
//
Server: Microsoft-IIS/5.0
//web
Date: Thu,08 Mar 200707:17:51 GMT
Connection: Keep-Alive
Content-Length: 23330
Content-Type: text/html
Expries: Thu,08 Mar 2007 07:16:51 GMT
Set-Cookie:ASPSESSIONIDQAQBQQQB=BEJCDGKADEDJKLKKAJEOIMMH; path=/
Cache-control: private
//
3.2 2.2 :
HTTP/1.0 404 Not Found
//
...
http
HTTP
HTTP
1
FTP SMTP DNS
NNTP HTTP
(Proxy)(Gateway)(Tunnel) URI
URI
()
(Proxy)
(Gateway)
HTTP
(Tunnel) HTTP
HTTP
(Portal)
(Intermediary)
HTTP
2
4 HTTP
TCP
SYNFlood SYN
SmurfTearDrop ICMP Flood IP
19 Chargen Chargen_Denial_of_Service
Chargen UDP DOWN
WEB 2 1. Chargen 2. HTTP
IP N Chargen ConnectChargen
72
5Http
Http
Http Http
.Http TCP/IP , Http
Http , TCP/IP
,.
1HEAD/Http/1.0 Http
2DELETE/Http/1.0 , Delete
3GET/Http/3.0 Http
4GET/JUNK/1.0 Http
Http Httprint,,,
Http . Http
CSDN
http://blog.csdn.net/gueter/archive/2007/03/08/1524447.aspx