精华区 [关闭][返回]

当前位置:网易精华区>>讨论区精华>>网络专区>>● Network>>● TCPIP>>RFC2068-HTTP/1.1(15)

主题:RFC2068-HTTP/1.1(15)
发信人: kenmlee()
整理人: kenmlee(2000-07-08 16:49:31), 站内信件
6.2 Response Header Fields

#6.2 响应头域 /#

   The response-header fields allow the server to pass additional
   information about the response which cannot be placed in the Status

-
   Line. These header fields give information about the server and abo

ut
   further access to the resource identified by the Request-URI.

#  响应头域允许服务器传递有关相应的附加信息,这类信息往往无法放到状态行


   这些头域给出一些关于服务器的信息和关于将来可能的请求URI标示的资源的

存取。
/#

          response-header = Age                     ; Section 14.6
                          | Location                ; Section 14.30
                          | Proxy-Authenticate      ; Section 14.33
                          | Public                  ; Section 14.35
                          | Retry-After             ; Section 14.38
                          | Server                  ; Section 14.39
                          | Vary                    ; Section 14.43
                          | Warning                 ; Section 14.45
                          | WWW-Authenticate        ; Section 14.46

#         response-header = Age                     ; 第14.6节
                          | Location                ; 第14.30节
                          | Proxy-Authenticate      ; 第14.33节
                          | Public                  ; 第14.35节
                          | Retry-After             ; 第14.38节
                          | Server                  ; 第14.39节
                          | Vary                    ; 第14.43节
                          | Warning                 ; 第14.45节
                          | WWW-Authenticate        ; 第14.46节
/#

   Response-header field names can be extended reliably only in
   combination with a change in the protocol version. However, new or


   experimental header fields MAY be given the semantics of response-


   header fields if all parties in the communication recognize them to


   be response-header fields. Unrecognized header fields are treated a

s
   entity-header fields.

#  只有协议版本改变时,响应头域的名称才可能有扩展。但是新的或试验性的头

域在通讯
   各方都能识别的情况下可以给响应头域以新的语义。不能识别的响应头域被认

为是实体
   头域。
/#

7 Entity
#7 实体 /#

   Request and Response messages MAY transfer an entity if not otherwi

se
   restricted by the request method or response status code. An entity


   consists of entity-header fields and an entity-body, although some


   responses will only include the entity-headers.

#  请求和响应消息可能在请求方法或响应状态码不限制的情况下传输一个实体。

一个
   实体由实体头域和实体体组成,虽然有些响应可能只包含实体头。
/#

   In this section, both sender and recipient refer to either the clie

nt
   or the server, depending on who sends and who receives the entity.



#  本节中,发送者和接收者都可能用于指客户程序或服务器程序,这依赖于谁在

发送和
   接收实体。
/#

7.1 Entity Header Fields

#7.1 实体头域 /#

   Entity-header fields define optional metainformation about the
   entity-body or, if no body is present, about the resource identifie

d
   by the request.

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

          extension-header = message-header

#  实体头域定义可选择的实体体的元信息,或者在没有实体体时定义关于请求所

标示
   的资源的元信息。

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

          extension-header = message-header
/#

   The extension-header mechanism allows additional entity-header fiel

ds
   to be defined without changing the protocol, but these fields canno

t
   be assumed to be recognizable by the recipient. Unrecognized header


   fields SHOULD be ignored by the recipient and forwarded by proxies.



#  扩展头部(extension-header)机制允许附加的实体头域在不改变协议的情况下


   可以定义,但是不能认为接收者一定可以识别这些头域。不能识别的头域应该

被接
   收者和代理忽略。
/#

7.2 Entity Body

#7.2 实体体 /#

   The entity-body (if any) sent with an HTTP request or response is i

n
   a format and encoding defined by the entity-header fields.

          entity-body    = *OCTET

#  HTTP请求或响应发出的实体体(如果有的话)是由实体头域定义其格式和编码的



          entity-body    = *OCTET
/#

   An entity-body is only present in a message when a message-body is


   present, as described in section 4.3. The entity-body is obtained
   from the message-body by decoding any Transfer-Encoding that may ha

ve
   been applied to ensure safe and proper transfer of the message.

#  只有消息中存在消息体时才可能包含实体体,见第4.3节的描述。实体体通过


   消息体解码(Transfer-Encoding)才能获得,这些编码为保证消息的安全性


   和更适合消息的传输而使用。
/#

7.2.1 Type

#7.2.1 类型 /#

   When an entity-body is included with a message, the data type of th

at
   body is determined via the header fields Content-Type and Content-


   Encoding. These define a two-layer, ordered encoding model:

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

#  当消息体包含实体体时,实体体的数据类型由内容类型(Content-Type)头域

和内容
   编码头域(Content-Encoding)决定,它们定义了一个两层有序的编码模式:



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

   Content-Type specifies the media type of the underlying data.
   Content-Encoding may be used to indicate any additional content
   codings applied to the data, usually for the purpose of data
   compression, that are a property of the requested resource. There i

s
   no default encoding.

#  Content-Type指定下层数据的介质类型,Content-Encoding可用于指定数据的

某种
   附加的编码类型,一般用于数据压缩的目的,这些数据用于给出请求资源的属

性。并
   没有缺省的编码。
/#

   Any HTTP/1.1 message containing an entity-body SHOULD include a
   Content-Type header field defining the media type of that body. If


   and only if the media type is not given by a Content-Type field, th

e
   recipient MAY attempt to guess the media type via inspection of its


   content and/or the name extension(s) of the URL used to identify th

e
   resource. If the media type remains unknown, the recipient SHOULD
   treat it as type "application/octet-stream".

#  任何包含实体体的HTTP/1.1消息应该包含一个Content-Type头域用于定义实体

体的
   介质类型。当且仅当Content-Type域未给出介质类型时,接收者可以通过检查

其内容
   和/或用于标示资源的URL的扩展名尝试着猜测它的介质类型。如果介质类型仍

无法识
   别,接收者应该将其视为“application/octet-stream”类型。
/#

7.2.2 Length

#7.2.2 长度 /#

   The length of an entity-body is the length of the message-body afte

r
   any transfer codings have been removed. Section 4.4 defines how the


   length of a message-body is determined.

#  实体长度是消息体解开传输编码后的长度。第4.4节定义了如何决定消息体的

长度。 /#


--
※ 修改:.kenmlee 于 Jul  8 16:37:57 修改本文.[FROM: 61.140.188.222]
※ 来源:.月光软件站 http://www.moon-soft.com.[FROM: 61.140.188.222]

[关闭][返回]