Enum that specifies the compression state of the byte stream of an HttpClientResponse.
The values herein allow callers to answer the following questions as they pertain to an HttpClientResponse:
Content-Length HTTP header be trusted?This enum is accessed via the HttpClientResponse.compressionState value.
The body of the HTTP response was received and remains in an uncompressed state.
In this state, the value of the Content-Length HTTP header, if specified (non-negative), should match the number of bytes produced by the response's byte stream.
HttpClientResponseCompressionState() The body of the HTTP response was originally compressed, but by virtue of the HttpClient.autoUncompress configuration option, it has been automatically uncompressed.
HTTP headers are not modified, so when a response has been uncompressed in this way, the value of the Content-Length HTTP header cannot be trusted, as it will contain the compressed content length, whereas the stream of bytes produced by the response will contain uncompressed bytes.
HttpClientResponseCompressionState() The body of the HTTP response contains compressed bytes.
In this state, the value of the Content-Length HTTP header, if specified (non-negative), should match the number of bytes produced by the response's byte stream.
If the caller wishes to manually uncompress the body of the response, it should consult the value of the Content-Encoding HTTP header to see what type of compression has been applied. See tools.ietf.org/html/rfc2616#section-14.11 for more information.
HttpClientResponseCompressionState() [notCompressed, decompressed, compressed]
© 2012 the Dart project authors
Licensed under the BSD 3-Clause "New" or "Revised" License.
https://api.dart.dev/stable/2.18.5/dart-io/HttpClientResponseCompressionState.html