1

I am trying to add "Accept-Encoding" parametr as "gzip,deflate" to my HTTP header using HttpClient. Code is given bellow. However I am getting bellow error with the response and unable to add the header parameter. Response doesn't contain the added header field

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);

Error : Internal Server Error

Roshanck
  • 2,220
  • 8
  • 41
  • 56

1 Answers1

0

Looks like a server configuration problem. Did you enable compression server side?

if you use jax-rs reasteasy replies with a compressed response if you have the headers set.

In other frameworks you might have to set it yourself. With @gzip or implementing a WriterInterceptor

Brendan
  • 1
  • 2