Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
What do these 'q=%f' mean?
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
What do these 'q=%f' mean?
This is called a relative quality factor. It specifies what language the user would prefer, on a scale of 0 to 1, as can be seen from the HTTP/1.1 Specification, §14.4:
Accept-languages quality parameter can be understood like this:
by attaching
Accept-Language: pl_PL;q=0.8, en_US;q=0.2,
header to the request we communicate to the server following messageSo for example, as a web page content provider we might introduce
Accept-Language
header parsing in such a way, that our website is suitable for foreigners speaking no English at all (then even translated navigation would be helpful (pages having translated only the navigation, lets say, haveq=0.1
), where fully translated content hasq=0.9
and fully translated content and verified by native speakers speaking both original language and translated language content might haveq=0.99
- because this is the only possible situation when meaning of the content is fully transduced)It is called the relative quality factor in the specification:
See also: