HTTP қ қң ө қ . ұ .
HTTP қ қң ө қ қ. .
ң - HTTP () қғ. ұ ү TCP/IP қ ә TCP қ. ң қғ ө 80; қ қ TCP .
ң - ң ұ : ұң қ (Request header) ә ү (ә ) ұ ң ү. қ ү ә, URL ә HTTP ө. ғ ү, ұ қ өң ғ қ .
Ү ң - ң , қ (Response header) ұ. ә ө. әң ұ ұ ә ң ө. қ , ө ң .
ө ң - / қң ү.
Request header ү ү:
GET /MyDoc.htm HTTP/1.1
Connection: Keep-Alive
User-Agent: Mozilla/3.0 (Win95; I)
Host: 212.54.196.226
Accept: image/gif, image/x-bitmap,
image/jpeg, *.*
ұ:MyDoc.htm - ұ құң ; GET- ұң ү; Host-IP--; Accept-ң .
Request header ғ құң ү:
POST /Scripts/ReadData.pl HTTP/1.1
Referer: http://212.54.196.226
Connection: Keep Alive
User-Agent: Mozilla/3.0 (Win95; I)
Host: 212.54.196.226
Accept: image/gif, image/x-bitmap,
image/jpeg, *.*
Content-type: application/x-www-form-urlencoded
Content-length: 38
FirstName=Mary+Ann&LastName=Sylvester
ұ: POST - ң ә. Referer- web- қң -, ұ қ құ ү ; Content-type- ң ә; Content-length - (). FirstName, LastName - өң ; Mary+Ann, Sylvester ә ( +ң ғ).
Web- ң ұ ,ғ HTML-құ , Response header ғ қ.
|
|
Response header құ :
HTTP/1.1 200 OK
Server: Microsoft-IIS/4.0
Date: Tue, 04 Apr 2005 00:26:34 GMT
Content-type: text/html
Set-Cookie: ASPSESSIONIDFFFYXKFR=ACMNFLJANKGBAMPBEGNGLEAB
<HTML>
{ HTML - }
ұ қ құғ.200OK-ұ ұ . ұ өң , қ қ ғ , 404 Object Not Found; Content-type-құң (ү). құ ө (ң HTML- , ө Content- type ә text/html ) ә қ ( ) ң ұ ү қ қ ө. (,jpeg ), web- қ Response header- , ұ Content-type, image/jpeg ғ . Set-Cookie - қ ә . ұ ө ү қ ұң қ.
ққ ә ң HTTP ұ ң ққ. ү:
POST http: //localhost/ HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Accept-Language: ru
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Host: localhost
Proxy-Connection: Keep-Alive
paraml=l¶m2=2
ұң POST ө ө. ұ ө ң ә ө. ұ ұң қ (param1=1¶m2=2) қ .
HTML құ ә ө. , ұ ү, қ:
<form action="http://localhost/" method="post">
<input type=hidden name="param1" value="1">
<input type=hidden name="param2" value="2">
<input type=submit></form>
ө, ү
[1- ]=[ 1- ә]& [2- ]=[ 2- ғ]&
Get ұ ә қ. ұң ө, - қ ұ, ә ү. ұ ө:
<form action="http://localhost/" method="get">
<input type=hidden name="param1" value="1">
<input type=hidden name="param2" value="2">
<input type=submit></form>
HTTP :
GET http://localhost/?param1=1¶m2=2 HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Accept-Language: ru
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
|
|
Host: localhost
Proxy-Connection: Keep-Alive
ө ұғ param1=1¶m2=2 ү ? , http://localhost/ қ. қ HTTP қ ө ө, қғ ө қ.
GET әң : қ құ ө. : ұ ә (POST ә қғ) ң ұғ , қ ұ құң - ұғ . ә, ұ ұ -, ққ ү қ 414 Request-URI Too Long ғ.
Ә: 1.[20-26],2.[80-98],7қ.[100-117],9қ.[211-234].
қ ұқ:
1. қң ө қ қ ң ұ?
2. қң ө қ Request header қң ғ қ?
3. қң ө қ Response header қң ғ қ?
4. қң ө қ қ ?