URL tailing slash

  • Without tailing slash

request header

GET /snippets HTTP/1.1
User-Agent: Fiddler
Host: 192.168.128.132

response header

HTTP/1.1 301 MOVED PERMANENTLY
Server: nginx/1.6.2
Date: Sat, 12 Sep 2015 08:05:41 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
X-Frame-Options: SAMEORIGIN
Location: http://192.168.128.132/snippets/
  • With a tailing slash

request header

GET /snippets/ HTTP/1.1
User-Agent: Fiddler
Host: 192.168.128.132

response header

HTTP/1.1 200 OK
Server: nginx/1.6.2
Date: Sat, 12 Sep 2015 08:18:15 GMT
Content-Type: applicaiton/json
Transfer-Encoding: chunked
Connection: keep-alive
X-Frame-Options: SAMEORIGIN

    14.30 Location>    
    The Location response-header field is used to redirect the recipient to a location other than the Request-URI for completion of the request or identification of a new resource. For 201 (Created) responses, the Location is that of the new resource which was created by the request. For 3xx responses, the location SHOULD indicate the server's preferred URI for automatic redirection to the resource. The field value consists of a single absolute URI.
           Location       = "Location" ":" absoluteURI 
    An example is:    
           Location: http://www.w3.org/pub/WWW/People.html    
          Note: The Content-Location header field (section 14.14) differs
          from Location in that the Content-Location identifies the original
          location of the entity enclosed in the request. It is therefore
          possible for a response to contain header fields for both Location
          and Content-Location. Also see section 13.10 for cache
          requirements of some methods.
posted @ 2015-09-12 16:25  小麦粉  阅读(361)  评论(0编辑  收藏  举报