unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Jason Rumney <jasonr@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Do you understand this?
Date: Sun, 06 Mar 2005 23:05:29 +0000	[thread overview]
Message-ID: <u8y504bpi.fsf@jasonrumney.net> (raw)
In-Reply-To: <m1D84Iy-0004RGC@rattlesnake.com> (Robert J. Chassell's message of "Sun, 6 Mar 2005 22:32:56 +0000 (UTC)")

"Robert J. Chassell" <bob@rattlesnake.com> 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.

  parent reply	other threads:[~2005-03-06 23:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-06 19:11 Do you understand this? Richard Stallman
2005-03-06 20:44 ` Nic Ferrier
2005-03-06 22:32   ` Robert J. Chassell
2005-03-06 22:58     ` Andreas Schwab
2005-03-06 23:05     ` Jason Rumney [this message]
2005-03-07 15:37       ` Robert J. Chassell
2005-03-07 17:10         ` Jason Rumney
2005-03-07 23:46           ` Robert J. Chassell
2005-03-08  0:34             ` Nic Ferrier
2005-03-08 18:41               ` Robert J. Chassell
2005-03-09 16:58                 ` Richard Stallman
2005-03-06 23:12     ` Nic Ferrier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=u8y504bpi.fsf@jasonrumney.net \
    --to=jasonr@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).