如何使用jetty发送https请求

时间:2015-08-07 09:51:33

标签: https request client embedded-jetty

这是我的客户端设置

    SslContextFactory sslContextFactory = new SslContextFactory();
    sslContextFactory.setKeyStorePath("keystore");
    sslContextFactory.setKeyStorePassword("blah");
    HttpClient httpClient = new HttpClient(sslContextFactory);

这就是我获取请求对象的方式。

        Request request = client.newRequest(host, port);

如何将请求发送为https?

感谢

1 个答案:

答案 0 :(得分:0)

答案是

request.scheme(HttpScheme.HTTPS.toString()):

全部是