Restlet-1.1 example\book\rest\ch2\Example2_5 没有 HTTPS 的客户端连接器
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看 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 thecom.noelios.restlet.ext.net.jar
file to my classpath.Apparently the Apache Commons HTTP Client is also supported for HTTPS.