精华区 [关闭][返回]

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

主题:RFC2068-HTTP/1.1(13)
发信人: kenmlee()
整理人: kenmlee(2000-07-08 16:49:24), 站内信件
5.2 The Resource Identified by a Request

#5.2 请求标示的资源 /#

   HTTP/1.1 origin servers SHOULD be aware that the exact resource
   identified by an Internet request is determined by examining both t

he
   Request-URI and the Host header field.

#  通过检查请求URI和主机头域(Host),HTTP/1.1的原始服务器应该能够知道


   Internet请求所指出的资源是哪一个。
/#

   An origin server that does not allow resources to differ by the
   requested host MAY ignore the Host header field value. (But see
   section 19.5.1 for other requirements on Host support in HTTP/1.1.)



#  不允许资源随主机不同的原始服务器可能会忽略主机头域(Host)值。(见


   第19.5.1节HTTP/1.1支持的Host的其他要求)
/#

   An origin server that does differentiate resources based on the hos

t
   requested (sometimes referred to as virtual hosts or vanity
   hostnames) MUST use the following rules for determining the request

ed
   resource on an HTTP/1.1 request:

#  区分资源随主机不同的原始服务器(有时是对虚拟主机或虚主机名)必须使用

下面
   的规则以决定一个HTTP/1.1请求的资源:
/#

     1. If Request-URI is an absoluteURI, the host is part of the
        Request-URI. Any Host header field value in the request MUST b

e
        ignored.

#    1. 如果请求URI是一个抽象URI,主机是请求URI的一部分,请求中的主机头域

值(Host)
        必须忽略。
/#

     2. If the Request-URI is not an absoluteURI, and the request
        includes a Host header field, the host is determined by the Ho

st
        header field value.

#    2. 如果请求URI不是抽象URI,并且请求包含主机头域(Host),主机决定于主

机头域值。
/#

     3. If the host as determined by rule 1 or 2 is not a valid host o

n
        the server, the response MUST be a 400 (Bad Request) error
        message.

#    3. 如果规则1或规则2决定的主机不是服务器上合法的主机,响应必须返回4

00
        (错误请求)错误消息。
/#

   Recipients of an HTTP/1.0 request that lacks a Host header field MA

Y
   attempt to use heuristics (e.g., examination of the URI path for
   something unique to a particular host) in order to determine what
   exact resource is being requested.

#  接收者如果接收到一个缺少主机头域的HTTP/1.0请求,可能会试图使用启发方


   (例如,监测对某些主机可能是唯一的URI路径)去决定到底是那个资源被请

求。
/#

5.3 Request Header Fields

#5.3 请求头域 /#

   The request-header fields allow the client to pass additional
   information about the request, and about the client itself, to the


   server. These fields act as request modifiers, with semantics
   equivalent to the parameters on a programming language method
   invocation.

#  请求头域允许客户程序给服务器传递请求的和客户程序本身的附加信息,这些


   是请求的修正,语义就像编程语言中方法调用的参数.
/#

          request-header = Accept                   ; Section 14.1
                         | Accept-Charset           ; Section 14.2
                         | Accept-Encoding          ; Section 14.3
                         | Accept-Language          ; Section 14.4
                         | Authorization            ; Section 14.8
                         | From                     ; Section 14.22
                         | Host                     ; Section 14.23
                         | If-Modified-Since        ; Section 14.24
                         | If-Match                 ; Section 14.25
                         | If-None-Match            ; Section 14.26
                         | If-Range                 ; Section 14.27
                         | If-Unmodified-Since      ; Section 14.28
                         | Max-Forwards             ; Section 14.31
                         | Proxy-Authorization      ; Section 14.34
                         | Range                    ; Section 14.36
                         | Referer                  ; Section 14.37
                         | User-Agent               ; Section 14.42

#         request-header = Accept                   ; 第14.1节
                         | Accept-Charset           ; 第14.2节
                         | Accept-Encoding          ; 第14.3节
                         | Accept-Language          ; 第14.4节
                         | Authorization            ; 第14.8节
                         | From                     ; 第14.22节
                         | Host                     ; 第14.23节
                         | If-Modified-Since        ; 第14.24节
                         | If-Match                 ; 第14.25节
                         | If-None-Match            ; 第14.26节
                         | If-Range                 ; 第14.27节
                         | If-Unmodified-Since      ; 第14.28节
                         | Max-Forwards             ; 第14.31节
                         | Proxy-Authorization      ; 第14.34节
                         | Range                    ; 第14.36节
                         | Referer                  ; 第14.37节
                         | User-Agent               ; 第14.42节
/#

   Request-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 request-
   header fields if all parties in the communication recognize them to


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

s
   entity-header fields.

#  请求头域名的扩展只有同时改变了协议版本时才可能。然而,新的或试验性的

头域可能
   给出,只要通讯各方能够理解请求头域的语义。不认识的头域作为实体头域对

待。
/#


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

[关闭][返回]