【发布时间】:2015-02-17 09:20:15
【问题描述】:
我正在尝试使用 HttpClient 将“Accept-Encoding”参数作为“gzip,deflate”添加到我的 HTTP 标头中。代码如下。但是,我收到以下响应错误并且无法添加标头参数。响应不包含添加的标头字段
String url = "http://192.168.1.25:8380/ABCDService?wsdl";
HttpClient client = HttpClientBuilder.create().build();
HttpPost post = new HttpPost(url);
post.addHeader( "Accept-Encoding", "gzip,deflate" );
HttpResponse response = client.execute(post);
错误:内部服务器错误
【问题讨论】:
-
服务器端是否开启了 gzip? :更多stackoverflow.com/questions/15999606/…
标签: java apache http http-headers apache-httpclient-4.x