Protokol HTTP

Protokol HTTP


Formy zaprosa i otveta
zaprosotvet

Protokol HTTP opredelyaet zapros-otvetnyj sposob vzaimodejstviya mezhdu programmoj-klientom i programmoj-serverom v ramkah tehnologii World Wide Web. Na etoj stranice privedeny primery zaprosa klienta i otveta servera v tom vide, kak oni byli prodampirovany iz steka programmy Trumpet Winsock:

Zapros klienta (Netscape Navigator 1.1 (Windows, 16 bit):

GET /httpddoc/setup/startit.htm HTTP/1.0
Referer: http://144.206.192.101/httpddoc/Overview.htm
User-agent: Mozilla/1.1N (Windows; 16bit)
Accept: */*
Accept: image/gif
Accept: image/x-xbitmap
Accept: image/jpeg

Otvet servera (WinHttpd 1.4a):

HTTP/1.0 200 OK
Date: Thursday, 12-Oct-95 02:51:33GMT
Seryeq: WinHttpd/1.4a (Shareware Non-Commercial License)
MIME-vers:on: 1.0
Content-type: image/gif
Last-modified: Monday, 20-Feb-95 13:48:10 GMT
Content-length: 218

47 49 46 
38 37 61 20 00 20 00 F3 0F 00 00 00 00 80 00 00 
00 80 00 80 80 00 00 00 80 80 00 80 00 80 80 80 
80 80 C0 C0 C0 FF 00 00 00 FF 00 FF FF 00 00 00 
FF FF 00 FF 00 FF FF FF FF FF 2C 00 00 00 00 20 
00 20 00 03 04 8F 10 C9 49 2B 02 C0 EA 6D 31 78 
87 C7 8D D4 17 82 66 46 8E 29 8A AE AC 7B 86 18 
AC B5 73 6A 57 78 BF 97 32 DF 4F D2 0B DA 44 97 
C7 E3 B3 34 C2 74 4C A5 B4 19 DA A5 A2 53 69 F5 
A8 AC 1E B2 5A 15 57 FB 05 6F C7 5A F0 EB 87 2D 
4F 0F 97 21 56 7D B6 AA DF 62 F6 1D 14 1F 26 EF 
75 72 74 7D 7E 44 66 79 85 7F 5D 84 89 8A 7C 88 
7E 1E 92 35 8D 17 0C 97 98 97 90 6C 99 5F 9A 95 
00 99 99 9B 56 9D 0F 9F 8D A1 A2 A8 89 AA 97 9E 
0C A4 95 24 11 00 3B 

Vsled za zagolovkom sleduet tekst peredavaemogo soobshcheniya, v dannom sluchae grafika. Soobshchenie otdelyaetsya ot zagolovka pustoj strokoj.