i am studying http protocol. when i use fiddler to catch a request, i find some arguments special.
part of http request:
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryiUs1bDxxBwTvwCxS
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,\*/\*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: zh-CN,zh;q=0.8
Accept-Charset: GBK,utf-8;q=0.7,*;q=0.3
What does the arguments q=0.9,\*/\*;q=0.8
in the Accept-header, q=0.8
in the Accept-Language-header and q=0.7,*;q=0.3
in the Accept-Charset-header mean?
Excerpt from this page http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html:
Note: Use of the "q" parameter name to separate media type parameters from Accept extension parameters is due to historical practice. Although this prevents any media type parameter named "q" from being used with a media range, such an event is believed to be unlikely given the lack of any "q" parameters in the IANA media type registry and the rare usage of any media type parameters in Accept. Future media types are discouraged from registering any parameter named "q".
This is basically a way to give the browser a way to indicate preference for a certain media type.
I think
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language
has better explanation to the question.
Quote from the website:
;q= (q-factor weighting)
Any value placed in an order of preference expressed using a relative quality value called weight.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With