java https客户端请求
Posted Kingsy blog
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了java https客户端请求相关的知识,希望对你有一定的参考价值。
String pathname = Test3.class.getResource("/client.jks").getFile(); System.out.println(pathname); SSLContext sslContext = SSLContexts.custom() .loadTrustMaterial(new File(pathname), "123456".toCharArray(), new TrustSelfSignedStrategy()) .build(); HttpGet request = new HttpGet("https://91ihealth.com:8443/"); HttpClient client = HttpClientBuilder.create() .setSslcontext(sslContext).build(); HttpResponse response = client.execute(request); System.out.println(StreamUtils.copyToString(response.getEntity().getContent(), Charset.defaultCharset()));
以上是关于java https客户端请求的主要内容,如果未能解决你的问题,请参考以下文章
jsp页面被tomcat引擎运行的时候组装成java片段,但是这些java片段怎么没有main方法作为程序的入口啊?