Java code for GET Request Accept Encoding Header ExampleThis Java code snippet was generated automatically for the GET Request Accept Encoding Header example.
<< Back to the GET Request Accept Encoding Header example
What is HTTP GET request?
The HTTP GET request method requests a resource from the server using the URL provided. The GET method is one of nine standard methods of HTTP (Hypertext Transfer Protocol). A GET request should only be used to retrieve data from a server. The HTTP GET requests cannot send data to the server on the body of an HTTP GET message and cannot change the server's state. To make changes to the server, use the PUT, POST, PATCH, or DELETE methods.
What is Accept-Encoding?
The Accept-Encoding HTTP Request Header is a request header comparison algorithm. All HTTP clients in use tell the server which encoding it supports. The server will then respond in any of the supported encoding formats. The server uses content negotiation to select one of the offers and informs the client of this choice with a Content-Encoding response header.
Accept-Encoding HTTP Header Syntax
The following is the syntax with the Accept-Encoding HTTP request header structure:
- gzip: a compression format based on the Lempel-Ziv coding (LZ77) and a 32-bit CRC.
- compress: a compression format based on the Lempel-Ziv-Welch (LZW) algorithm.
- deflate: a compression format based on Zlib, using the deflate compression algorithm.
- br: a compression format based on the Brotli algorithm.
- identity: the directive indicates the identity acceptable function
- *: the directive matches any encoding in the header, whether listed or not. It is the default value.
Accept-Encoding HTTP Header Examples
The Accept-Encoding HTTP request header passes the appropriate compressed data to the web browser. The following is an example of the format for using the Accept-Encoding HTTP request header: