1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Apache HttpClientで、リクエストヘッダーに"Accept-Encoding" の設定でgzipを自動設定しないようにする方法について

Last updated at Posted at 2024-11-08

案1

リクエストヘッダーの "Accept-Encoding"の値を "":空文字、または、 "identity" 設定

参考URL
https://siguniang.wordpress.com/2014/02/23/what-is-identity-content-encoding/

案2

以下のような実装で、自動コンテンツ解凍を無効にできそうです
HttpClient client = HttpClients.custom().disableContentCompression().build();

参考URL
https://stackoverflow.com/questions/32354232/how-to-disable-compression-handling-in-apache-httpasyncclient
https://hc.apache.org/httpcomponents-client-4.5.x/current/httpclient/apidocs/org/apache/http/impl/client/HttpClientBuilder.html#disableContentCompression()

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?