Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the common types of accept encoding

Shulou Source: shulou.com Published: 2022-06-03 11:02:31 09月30日 Update

Editor to share with you what are the common types of accept encoding, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

In Accept-Encoding,HTTPHeader, Accept-Encoding is sent to the server by the browser, declaring the type of encoding supported by the browser.

Accept-Encoding Typ

Accept-Encoding:compress,gzip// supports compress and gzip types

Accept-Encoding:// defaults to identity

Accept-Encoding:*// supports all types of Accept-Encoding:compress;q=0.5,gzip;q=1.0// support gzip,compress sequentially

Accept-Encoding:gzip;q=1.0,identity;q=0.5,*;q=0// supports gzip,identity sequentially

The corresponding type code header returned by the server is content-encoding. The server's rules for handling accept-encoding are as follows: 1. If the server can return any Encoding type defined in Accept-Encoding, the process is successful (unless the value of Q equals 0, which indicates unacceptable)

2.* represents any Encoding type (except for the type defined in Accept-Encoding)

3. If there are multiple Encoding matches at the same time, arrange them in Q-value order

4.identity is always an acceptable encoding type (unless the tag shown is of the type qroom0)

If the value of Accept-Encoding is empty, then only identity is the accepted type

If all types of servers in Accept-Encoding do not send a return, you should return a 406 error to the client

If there is no Accept-Encoding in the request, the server assumes that all Encoding is acceptable.

If there is identity in Accept-Encoding, then identity should be returned first (unless there is a definition of Q value, or you think another type is more meaningful)

What does Accept-Encoding pay attention to?

If the server does not support identity and the browser does not send Accept-Encoding, then the server should tend to use the "gzip" and "compress" in HTTP1.0, and the server may send a more appropriate encoding type according to the client type. Most HTTP1.0 clients cannot handle Q values.

The above is all the content of the article "what are the common types of accept encoding". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Type server service support client client browser article order processing browsing common representative content most coding success not much tendency only Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Redmi Linux vpn Microsoft