Professional Documents
Culture Documents
4/28/12
HTTP METHODS
CONNECT DELETE GET
-Optional
-Optional
-Required
Asks server to reply as if it were going to return the requested resource, but not to include the resource itself in the response.
4/28/12
HTTP METHODS
OPTIONS
-Optional
Asks server to indicate the options it supports for the indicated resource.
POST
-Optional
-Optional
The Accept header, which is a request header, lets a client explicitly indicate what types of content it can accept in the message body of the servers response, as well as its relative preference for each content type.
EX: Accept: text/plain; q=0.5, text/html, text/x-dvi; q=0.8, text/x-c
4/28/12
Accept-Charset
Clients can include an Accept-Charset header in their requests to tell the server which character encodings they prefer for the message body returned in the response. The Accept-Charset header acts much like the basic Accept header (as well as other headers in the Accept- family). Clients may include a list of different character sets, and they can indicate a relative preference for different character sets by including a quality factor. If the quality factor is absent,the server assumes a value of 1.0.
4/28/12
The Accept-Encoding header gives clients another way to express their preferences for the message body of the servers response. In addition to content type (the Accept header) and character set (the Accept-Charset header), this header lets clients suggest content encodings for the response. (The TE header, described in section 3.2.44, lets clients express preferences for transfer encodings.) The format of the header is the same as the other Accept headers, a list of acceptable encodings, each with an optional quality factor.
4/28/12
This header lets the client express a preference for the language of the returned message. EX:Accept-Language: en-gb, en; q=0.8
Age The Age header is a response header that estimates the age of the associated resource. Cache servers use this value to judge whether a cached resource is still valid or whether it has expired and must be refreshed from the origin server. The Age headers value is the number of seconds that the sender estimates have elapsed since the origin server generated or revalidated the response.
4/28/12
The Allow header identifies which http methods a particular resource supports. The header simply lists those methods as its value. The text below, for example, indicates that a resource supports the GET, HEAD, and PUT methods.
The Authentication-Info completes a three-message user authentication exchange. It is a response header that servers can include in a successful response, and it gives the client additional information about the authentication exchange.
4/28/12
Clients use the Authorization header to identify and authenticate themselvesor their usersto a server.
Cache-Control
The Cache-Control header is a master header for several different directives that specify caching behavior. These directives , some of which have parameters associated with them and some of which do not, are separated from each other by commas. EX: Cache-Control: max-age=3600, no-transform, no-cache="Accept-Ranges"
4/28/12
The Connection header allows the message sender (the client in the case of requests, the server for responses) to indicate to proxies any other headers in the message that should not be forwarded further. Consider the example of figure 3.8. In the figure,the client issues a request that includes two message headers: Upgrade and Connection. The proxy server,
4/28/12
The Content-Encoding header identifies any special encodings that are an inherent part of the resource contained in the message body. EX: Content-Encoding: gzip
Content-Length
The Content-Length header gives the size of the message body in bytes or, in the case of a response to a HEAD method, the size of the message body if it were to be included.
4/28/12
4/28/12
4/28/12
Expires
The Expires header indicates a time, beyond which a resource may no longer be valid. Until then, caches may keep a copy of the response and return that copy in response to subsequent Requests. EX: Expires: Thu, 01 Dec 1994 16:00:00 GMT
4/28/12
EX:From: stephen.thomas@waterscreek.com
4/28/12
4/28/12
If-None-Match The If-None-Match header is the complement of the IfMatch header; it has the exact opposite effect. When a client includes If-None-Match, it asks a server to complete a request only if the indicated resource has an entity tag that differs from that in the header. If-Unmodified-Since condition doe not hold, a server returns a 412 Precondition Failed status.
4/28/12
4/28/12
Location
Servers use the Location header to redirect clients to a new uri for a resource. The most common use of Location is in responses with 3xx status codes, but a server might also use Location in a 201 Created response. In that case, the header would tell a client where it could retrieve a copy of a resource that it just sent to the server using a PUT method.
4/28/12
4/28/12
4/28/12
Proxy-Authenticate
The Proxy-Authenticate header lets intermediate proxy servers authenticate a client. By including this header in a response, the proxy asks the client to reissue the request but to include its authorization credentials. Proxy servers must always include Proxy-Authenticate in any response with a 407 Proxy Authentication Required status. In operation, Proxy-Authenticate is similar to WWW-Authenticate, except that it is generated by proxy servers rather than origin 4/28/12 servers.
4/28/12
Retry-After
Servers use the Retry-After header to tell a client when it should retry its request. The header can specify a date, so that the following header asks a client to wait until 1 January 2001 to reissue its request. EX: Retry-After: Sun, 31 Dec 2000 23:59:59 GMT
4/28/12
TE
The TE header tells a server which transfer encodings the client can accept in a response, and it can indicate the clients relative preferences for those transfer encodings. This header is very similar to the Accept-Encoding header, except that it applies to transfer encodings rather than content encodings. EX:TE: gzip, deflate;q=0.9
4/28/12
Upgrade
The Upgrade header lets a client and server gracefully negotiate an upgrade to a different communications protocol. The new protocol may be a newer version of http or a completely different protocol such as Transport Layer Security. EX:GET http://www.bank.com/acct.html?749394889300 HTTP/1.1 4/28/12 Host: www.bank.com
4/28/12