lua-users home
lua-l archive

Re: HTTP q values parser?

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


On Sep 25, 2009, at 9:52 AM, Philippe Lhoste wrote:
I always wondered what is the real usage of these. The reference, which you are kind enough to provide, isn't very helpful. Is that fuzzy logic? :-)
This is related to the so-called "content negotiation":
http://www.w3.org/Protocols/rfc2616/rfc2616-sec12.html
For example, a browser could send a language preference, e.g.:
Accept-Language: en-us,en;q=0.5,fr;q=0.1
In other words, give the content in American English, English, or French, in that order of preference. The "quality" value (e.g. q=0.5) provides a mean to sort the preferences.
Another common example would be encoding:
Accept-Encoding: gzip,deflate
This tell the server that the content can be compressed when sending a response, and that gzip would be preferred over deflate.
In any case, will hack something with the string library :D
Cheers,
PA.

AltStyle によって変換されたページ (->オリジナル) /