nazad | soderzhanie | vpered

7 Ob容kt (Entity).

Soobshcheniya zaprosov i otvetov MOGUT peredat' ob容kt, esli inoe ne ustanovleno metodom zaprosa ili kodom sostoyaniya otveta. Ob容kt sostoit iz polej zagolovka ob容kta (entity-header) i tela ob容kta (entity-body), hotya nekotorye otvety mogut vklyuchat' tol'ko zagolovki ob容kta (entity-headers).

|tot razdel otnositsya kak k otpravitelyu, tak i k poluchatelyu, to est' k klientu ili serveru, v zavisimosti ot togo, kto posylaet, a kto poluchaet ob容kt.

7.1 Polya zagolovka ob容kta.

Polya zagolovka ob容kta (Entity-header fields) opredelyayut opcional'nuyu metainformaciyu o tele ob容kta ili, esli telo ne prisutstvuet, otnositel'no resursa, identificirovannogo zaprosom.

          entity-header  = Allow                    ; Razdel 14.7
                         | Content-Base             ; Razdel 14.11
                         | Content-Encoding         ; Razdel 14.12
                         | Content-Language         ; Razdel 14.13
                         | Content-Length           ; Razdel 14.14
                         | Content-Location         ; Razdel 14.15
                         | Content-MD5              ; Razdel 14.16
                         | Content-Range            ; Razdel 14.17
                         | Content-Type             ; Razdel 14.18
                         | ETag                     ; Razdel 14.20
                         | Expires                  ; Razdel 14.21
                         | Last-Modified            ; Razdel 14.29
                         | extension-header

          extension-header = message-header

Mehanizm rasshireniya polej zagolovka pozvolyaet vvodit' dopolnitel'nye polya zagolovka ob容kta (entity-header fields) ne izmenyaya protokol, no eti polya ne mogut schitat'sya raspoznavaemymi poluchatelem. Neraspoznannye polya zagolovka poluchatelyu SLEDUET ignorirovat', a proksi-serveru peresylat' bez izmenenij.

7.2 Telo ob容kta.

Telo ob容kta (esli ono prisutstvuet) posylaetsya s HTTP zaprosom ili otvetom i imeet format i kodirovanie, opredelyaemoe polyami zagolovka ob容kta (entity-header fields).

          entity-body    = *OCTET

Telo ob容kta (entity-body) predstavleno v soobshchenii tol'ko togda, kogda prisutstvuet telo soobshcheniya (message-body), kak opisano v razdele 4.3. Telo ob容kta (entity-body) poluchaetsya iz tela soobshcheniya (message-body), dekodirovaniem kodirovaniya peredachi, ukazannogo v pole Transfer-Encoding, i kotoroe mozhet byt' primeneno dlya garantirovaniya bezopasnoj i pravil'noj peredachi soobshcheniya.

7.2.1 Tip (Type).

Kogda telo ob容kta (entity-body) vklyucheno v soobshchenie, tip dannyh etogo tela opredelyaetsya polyami zagolovka Content-Type i Content-Encoding. Oni opredelyayut dvuhurovnevuyu uporyadochennuyu model' kodirovaniya:

          entity-body := Content-Encoding( Content-Type( data ) )

Tip soderzhimogo (Content-Type) opredelyaet media tip osnovnyh dannyh. Kodirovanie soderzhimogo (Content-Encoding) mozhet ispol'zovat'sya dlya ukazaniya lyubogo dopolnitel'nogo kodirovaniya soderzhimogo, primenennogo k dannym (obychno s cel'yu szhatiya dannyh). Kodirovanie soderzhimogo (Content-Encoding) yavlyaetsya svojstvom zaproshennogo resursa. Po umolchaniyu nikakogo kodirovaniya ne zadano.

V lyuboe HTTP/1.1 soobshchenie, soderzhashchee telo ob容kta (entity-body) SLEDUET vklyuchat' pole zagolovka Content-Type, opredelyayushchee media tip etogo tela. V tom i tol'ko v tom sluchae, kogda media tip ne predstavlen polem Content-Type, poluchatel' MOZHET popytat'sya predpolozhit' media tip, proveryaya soderzhimoe i/ili rasshirenie (rasshireniya) v imeni URL, ispol'zuemogo dlya identifikacii resursa. Esli media tip ostalsya neraspoznan, poluchatelyu SLEDUET obrabatyvat' ego kak tip "application/octet-stream".

7.2.2 Dlina (Length).

Dlina tela ob容kta (entity-body) - eto dlina tela soobshcheniya (message-body), poluchennogo posle dekodirovaniya vseh kodirovanij peredachi. Razdel 4.4 opredelyaet kak vychislyaetsya dlina tela soobshcheniya (message-body).


Copyright  ©  1998 Alex Simonoff (http://www.omsk.com/Leshik/), All Rights Reserved.


nazad | soderzhanie | vpered