HTTP headers (c)

In response header field

Response header field is returned to the client the response packet field used by the server. Additional information used to supplement the response, server information, and the additional requirements of the client.

Accept-Ranges

Accept-Ranges:bytes

Accept-Ranges header field is used to tell whether the client server can handle a range request to specify access to resources on the server side of a section.
There are two field values may be specified, which is a designated range of bytes that can handle the request, otherwise designated as none.

Age

Age:600

Age header field can tell the client, the source server how long ago created a response. Unit field value is in seconds.
If the server is created as a response to the cache server, Age value means the cache initiates an authentication response to the time value of authentication is complete again.

ETag

ETag:"9819364440793772187"

ETag header field can inform the client entity identifier. It is an unique identification of the resources to do a string manner. Corresponding to each server resource allocation ETag value.
When the resource is cached, it will be assigned a unique identification.
Strong and weak ETag value ETag value
ETag have strong points and weak ETag value of the ETag value

  • Strong ETag value
    strong ETag value, no matter how subtle changes in the entity will change its value
ETag:"usagi-1234"
  • Weak ETag value
    weak ETag value only if prompt for the same resources. Only resources a fundamental change, will change the ETag value when a difference. At this time, the value will be the beginning of the additional W / in the field.
ETag: W/"usagi-1234"

Location

Request packet:

GET /sample.html

Returns a redirect, transfer locations:

302  Found
Location:http://www.usagedesign.jp/sample.html

According to location returned to relaunch request:

GET  /sample.html

Returns a successful response:

200 OK

Using the Location header field in response to a position different from the request URI of the resource can be directed to the recipient.
Basically, the fields with 3xx: Redirection responses, providing redirection URI.

Proxy-Authenticate

Proxy-Authenticate:Basic  realm="Usagidesign Auth"

Transmitting the authentication information Proxy-Authenticate header field will by the proxy server to the client requested
the authentication behavior is performed between the client and the proxy.

Retry-After

Retry-After:120

Example represents the 120 seconds before attempting to access the
header fields Retry-After informing the client should send a request again after long. Mainly with status code 503 Service Unavailable response, or a response to use with 3xx Redirect.

Server

Server:Apache/2.2.17(Unix)

Server header field tells the client information HTTP server applications currently installed on the server. It will be marked not only the name of the software application on the server, and may include enabled and installed version number of options.

Vary

Vary:Accept-Language

Vary That change means, how to understand the change?
Refers to the return way to respond to a change
when the proxy server receives a request with a header field specifies Vary access to resources, the value of the Accept-Language field of the same, if used, then returns a response directly from the cache. On the contrary, it will need access to resources after starting with the source server to return a response.

WWW-Authenticate

WWW-Authenticate: Basic realm="Usagidesign Auth"

WWW-Authenticate header field for HTTP access authentication. It will tell the client to an access request URI applicable certification program resources (Basic or Digest) and with arguments prompt the question (challenge) specified.

Entity header fields

Entity header field containing information related to the entity header portion, the update time for the supplemental content request packet and the response packet in the solid portions to be used.

Allow

Allow:GET,HEAD

All HTTP header field Allow method used to notify the client is able to support the Request-URI of the specified resource. When the server receives the HTTP does not support the method, will be a status code 405 Method Not Allowed returned as the response. At the same time, but also to be able to support the HTTP method to write the header fields Allow returned.

Content-Encoding

Content-Encoding:gzip

Content-Encoding header field tells the client-server content encoding for the main part of the entity of choice. Content encoding means compression without loss of information is carried out by the entity.

Content-Language

Content-Language:zh-Cn

Content-Language header field tells the client entity body using natural language (such as Chinese or English language refers)

Content-Length

Content-Length:15000

Content-Length header field indicates the size of the entity body portion (in bytes). When the content of the entity body encoded and transmitted, no longer use the Content-Length header field.

Content-Location

Content-Location:http://www.hackr.jp/index-ja.html

Content-Location header field of the message is given and the main body portion corresponding to the URI. And various header fields Location, Content-Location indicates the message body is returned resource corresponding URI.

Content-MD5

Content-MD5:OGFKZUwHDGSGEWEewewrweiH==

Content-MD5 purpose is to check whether the packet body remains intact during transmission, and acknowledgment transmission reach.
Packet body receiving client will perform the same MD5 algorithm, and then compared with the value of the field Content-MD5 header field of the packet can be judged that the accuracy of the body.
Note: In this method, the changes of incidental content is no way to verify, and malicious tampering can not be detected because Content-MD5 may then recalculate been tampered with.

Content-Range

Content-Range:bytes 5001-10000/10000

For the scope of the request header fields used when the response is returned Content-Range, which can inform the client as part of the entity's response back in line with the scope of the request. Field value in bytes, indicating the current transmission portion and a size of the entire entity.

Content-Type

Content-Type:text/html;charset=UTF-8

Content-Type header field describes the media type of the entity within the body of the object. And Accept header fields as field values ​​with type / subtype in the form of an assignment.

Expires

Expires:Wed, 04  Jul  2012  08:26:05  GMT

Date Expires header field will fail to inform the client resources.
In the cache server after receiving a response containing the Expires header field, will be a response request to the cache, Expires field value before the specified time, a copy of the response will always be saved. After more than a specified period of time, the cache server when a request is sent over, turn to the source server resource requests.

Last-Modified

Last-Modified:Mon, 23 Oct 2017 10:01:51 GMT

Last-Modified header field indicates the final modified resource time. Generally, this value is the Request-URI specifies the resource to be modified.

Cookie header field for the service

Cookie header field for the service are as follows:

Header field name Explanation Type header
Set-Cookie Cookie state management information used to start In response header field
Cookie Cookie information received by the server Request header fields

Set-Cookie

Set-Cookie: BD_CK_SAM=deleted; expires=Thu, 01-Jan-1970 17:00:00 GMT; path=/; domain=.m.baidu.com

When the server is ready to start managing the status of the client, it will be informed in advance a variety of information.
The following table lists the Set-Cookie field value of

Attributes Explanation
NAME=VALUE Cookie and the name given to its value
expires=DATE Cookie valid (if not explicitly specify the default browser closes the front)
path=PATH The file directory on the server application target of Cookie (if not specified, the default directory for the file the document resides)
domain = domain name Cookie domain name as applicable object (if not specified, the default is to create a Cookie domain name server)
Secure Cookie will be sent only when the HTTPS secure communication
HttpOnly Restrictions, the Cookie JavaScript script can not be accessed

Cookie

Cookie:status=enable

Cookie header field tells the server when the client wants to get HTTP state management support, will be received from the server that contains the Cookie in the request. Upon receiving the plurality of Cookie, Cookie may also be transmitted in a plurality of forms.

Published 75 original articles · won praise 7 · views 10000 +

Guess you like

Origin blog.csdn.net/zhengdong12345/article/details/99707948