You are on page 1of 3

Server Response

Server Headers

Content-Base: The base URL for resolving relative URLs within the document.

Content-Length: Specifies the length of the body in bytes. Browsers use this to tell the user the
percentage of the download that is complete.

Content-Type: Specifies the media type of the body e.g. text/html for HTML documents,
text/plain for text documents and application/pdf for Adobe pdf documents

Date: Specifies the date and time when response was sent e.g. Monday, 06-Aug-99 19:01:42
GMT

Last-modified: Date and time when requested resource was last modified

Location: Specifies the new location of the resource. Used to inform client to look elsewhere for
requested resource and consist of absolute URL of new location. This header is accompanied by
3xx series status code.

Server: Specifies the name and version of the application acting as web server.

Set-Cookie: Specifies a name-value pair which browser should provide with future requests

e.g. Set-Cookie: cart_id=12345; path=/; expires=sat, 18-Mar-05 19:06:19 GMT

Proxies
Content-Negotiation
Content-negotiation allows clients and servers to negotiate the best possible format for each
given resource.

Four primary types of negotiation: language, character-set, media type and encoding

Media type:

Client specifies the list of preferred HTTP media types. Accept header list contains HTTP media
types in type/subtype format used by the Content-Type header followed by optional quality
factors between 0 and 1.Default is 1.

Accept: text/html;q=1, text/plain;q=0.8,


Image/jpeg, image/gif, */*;q=0.001

Language and Character Set

Combined these two provide internationalization.

Accept-Charset: iso-8859-5, iso-8859-1; q=0.5


Accept-Language: ru, en-gb; q=0.5, en; q=0.4

The first line indicates that the server should return the content in Cyrillic if possible or Western
Roman otherwise.
The language specifies Russian as the first choice, British English as the second, and other forms
of English as the third.

Encoding

Options for encoding includes gzip, compress and identity.

Accept-Encoding: compress, gzip

You might also like