Restlet-1.1 example\book\rest\ch2\Example2_5 没有 HTTPS 的客户端连接器

发布于 2024-08-04 05:56:46 字数 658 浏览 8 评论 0原文

Example2_5 创建 HTTPS 客户端来处理请求

final Response response = new Client(Protocol.HTTPS).handle(request);

Restlet-1.1 中唯一相关的 jar 是 org.mortbay.jetty.https.jar,我将其添加到运行时类路径中。

尽管如此,我在运行时得到了

[java] WARNING: No available client connector supports the required protoco
ls: 'HTTPS' . Please add the JAR of a matching connector to your classpath.

返回

final DomRepresentation document = response.getEntityAsDom();

虽然这是一个警告,但它会导致 null 作为“Isanyone can run any of Examples in Restlet-1.1 that is Restlet equals of Ruby's example from “RESTful Web Services”一书中的

?维塔利

Example2_5 creates a client for HTTPS to handle request

final Response response = new Client(Protocol.HTTPS).handle(request);

The only related jar in Restlet-1.1 is org.mortbay.jetty.https.jar, which I added to my runtime classpath.

Nevertheless, I am getting at runtime

[java] WARNING: No available client connector supports the required protoco
ls: 'HTTPS' . Please add the JAR of a matching connector to your classpath.

Although it's a warning, it leads to null as a return on

final DomRepresentation document = response.getEntityAsDom();

Was anyone able to run any of Examples in Restlet-1.1 that are restlets equivalents of Ruby's example from "RESTful Web Services" book?

Vitaly

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

秋千易 2024-08-11 05:56:46

查看 Restlet 连接器网页,没有适用于 HTTPS 的 Jetty 客户端连接器。

我能够使用“Net”连接器(基于 java.net 类)获得更好的结果,这需要我添加 com.noelios.restlet.ext.net.jar 文件到我的类路径。

显然 Apache Commons HTTP 客户端也支持 HTTPS。

Looking at the Restlet connectors web page, there is no Jetty client connector for HTTPS.

I was able to get better results with the "Net" connector (based on the java.net classes), which required me to add the com.noelios.restlet.ext.net.jar file to my classpath.

Apparently the Apache Commons HTTP Client is also supported for HTTPS.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文