emacs-devel
[Top][All Lists]
Advanced

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

Re: Do you understand this?


From: Andreas Schwab
Subject: Re: Do you understand this?
Date: Sun, 06 Mar 2005 23:58:29 +0100
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/22.0.50 (gnu/linux)

"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?

The header's value is a comma separated list of elements, where each one
can contain parameters separated by semicolons.  The "q" parameter
defaults to 1 if absent.

       Accept         = "Accept" ":"
                        #( media-range [ accept-params ] )

       media-range    = ( "*/*"
                        | ( type "/" "*" )
                        | ( type "/" subtype )
                        ) *( ";" parameter )
       accept-params  = ";" "q" "=" qvalue *( accept-extension )
       accept-extension = ";" token [ "=" ( token | quoted-string ) ]

> 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
>
> and mean the same as
>
>        Accept: text/plain           ; q=0.5, 
>                text/html, text/x-dvi; q=0.8, 
>                text/x-c             ; q=1.0
>
> Is this the case?

Close.

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

Andreas.

-- 
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




reply via email to

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