I wrote below sample program to check response of http
public class CloseableHttpClientExmpl { public static void main(String[] args) { CloseableHttpClient client =HttpClients.custom().disableContentCompression().build(); HttpGet request = new HttpGet("http://localhost:8080/index.php"); CloseableHttpResponse response=null; try { response = client.execute(request); System.out.println(response); } catch (ClientProtocolException e1) { e1.printStackTrace(); } catch (IOException e1) { e1.printStackTrace(); } } } The output/response is like below
HttpResponseProxy{HTTP/1.1 200 OK [Date: Thu, 11 Apr 2019 12:48:38 GMT, Server: Apache/2.4.18 (Win32) OpenSSL/1.0.2e PHP/7.0.8, X-Powered-By: PHP/7.0.8, Content-Length: 79, Keep-Alive: timeout=5, max=99, Connection: Keep-Alive, Content-Type: text/html; charset=UTF-8] ResponseEntityProxy{[Content-Type: text/html; charset=UTF-8,Content-Length: 79,Chunked: false]}} Now I want to know that How can I remove software informations like below from this response
Server: Apache/2.4.18 (Win32) OpenSSL/1.0.2e PHP/7.0.8, X-Powered-By: PHP/7.0.8