Header Structure

HTTP represents headers as a composition of parts and parameters. A simple header will have only one part, for example:

Location: www.nokia.com

More complex headers consist of a number of parts, separated by semicolon (;) or comma (,) characters. In RFC 2616, these are defined with the EBNF notation 'rule - A construct "#" is defined, similar to "*", for defining lists of elements...'

An example of a multiple-part header is:

Accept: text/*, text/html, */*

The three parts have values text/*, text/html and */* respectively. When setting up a header like this, the client only needs to specify the parts, and need not be concerned with separator characters. Separators are handled automatically by the built-in header codec.

Some header fields allow one or more parameters to be associated with individual header parts. An example of a header with parameters is:

Content-Type: text/html; charset=ISO-8859-4

The Content-Type header has a single part (value 'text/html') that has a single parameter (named 'charset', value 'ISO-8859-4'). Again, the client need only be concerned with setting part and parameter values; the separators including the '=' character are dealt with automatically.