[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Do you understand this?

From: Jason Rumney
Subject: Re: Do you understand this?
Date: Sun, 06 Mar 2005 23:05:29 +0000
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (windows-nt)

"Robert J. Chassell" <address@hidden> writes:

>            Accept: text/plain; 
>                    q=0.5, text/html, text/x-dvi; 
>                    q=0.8, text/x-c
>     If sent in an HTTP request for a resource /fred the above Accept
>     headers tells the server that the user will ideally accept /fred as an
>     HTML document or a text/x-c document. 
> I do not understand.
> Am I right in formatting the statement such that semi-colons have a
> higher precedence than commas?

Somewhat unintuitively in HTTP headers their precedence is reversed
from what you might expect in English text. Commas seperate header
values and are shorthand for multiple headers, so the above could be
rewritten more clearly as:

Accept: text/plain; q=0.5
Accept: text/html
Accept: text/x-dvi; q=0.8
Accept: text/x-c

Also q defaults to 1.0 if not explicitly stated, so text/x-c and
text/html have highest priority.

> An alternative formatting is that semi-colons precede q settings, and
> that if a format lacks a q setting, it has the highest priority.

Basically right, but your reformatting suggests that you may be
thinking that text/html inherits the q=0.8, which is not correct.

> Thus, the above could be formatted like this
>        Accept: text/plain; q=0.5, 
>                text/html, text/x-dvi; q=0.8, 
>                text/x-c

There is also an Accept-Charset header with the same rules, which fits
the original manual description slightly better.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]