hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ok2c <...@git.apache.org>
Subject [GitHub] httpclient issue #75: Add Brotli support
Date Mon, 01 May 2017 14:22:17 GMT
Github user ok2c commented on the issue:

    https://github.com/apache/httpclient/pull/75
  
    @pmouawad I am not sure it is a good idea to introduce a hard dependency on an external
library for a single decompression codec, especially given it is quite easy to plug it in
with HttpClientBuilder. If the brotli codec were supported by Commons Codec it would be easier
to add it to the default configuration. 
    
    ```
    LinkedHashMap<String, InputStreamFactory> contentDecoderMap = new LinkedHashMap<>();
    contentDecoderMap.put("gzip", new InputStreamFactory() {
    
        @Override
        public InputStream create(final InputStream instream) throws IOException {
            return new GZIPInputStream(instream);
        }
    
    });
    contentDecoderMap.put("br", new InputStreamFactory() {
    
        @Override
        public InputStream create(final InputStream instream) throws IOException {
            return new BrotliInputStream(instream);
        }
    
    });
    CloseableHttpClient httpclient = HttpClients.custom()
            .setContentDecoderRegistry(contentDecoderMap)
            .build();
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message