我使用过HttpClientBuilder 4.3.3.jar
我需要将Post请求中的压缩json params发送到服务器,但是在服务器上我将请求参数设置为空白
CloseableHttpClient client =
HttpClientBuilder.create().useSystemProperties().build();
HttpClientContext context = setClientCredentials(client, username, password, uri);
HttpPost post_method= new HttpPost( uri);
HttpEntity entity = EntityBuilder.create().setText(params).setContentType(ContentType.APPLICATION_JSON).gzipCompress().build();
post_method.setEntity(entity);
client.execute(post_method)