使用 java.net.URLConnection 的 Clojure http 请求?

发布于 2024-09-25 15:55:23 字数 498 浏览 0 评论 0 原文

是否有任何使用 java.net.URLConnection 类的 Clojure http 库?我问的原因是因为根据文档

我目前正在使用 com.twinql.clojure.http 进行 GET 请求,但我不认为使用正确的接口,因为我在建立连接时遇到此错误:

java.security.AccessControlException: access denied (java.net.SocketPermission www.googleapis.com resolve)

Are there any Clojure http libraries that use the java.net.URLConnection class? Reason I'm asking is because that's the only accepted way to make http connections on Google App Engine, according to the docs.

I'm currently using com.twinql.clojure.http for my GET requests, but I don't think that uses the right interface because I'm getting this error on making the connection:

java.security.AccessControlException: access denied (java.net.SocketPermission www.googleapis.com resolve)

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

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

发布评论

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

评论(2

溇涏 2024-10-02 15:55:23

clojure.contrib.http.agent 似乎可以解决问题。

*感谢 #clojure 上的 LauJensen

clojure.contrib.http.agent seems to do the trick.

*thanks to LauJensen on #clojure

缪败 2024-10-02 15:55:23

五年后更新 yayitswei 的答案......

此时, clojure.contrib.http.agent 已被弃用,并且 clj建议改为使用 -http,但它使用 Apache HTTPComponents 客户端,这对 Google App Engine 不利。

任何想要部署到 Google App Engine 的人都应该使用 clj-http-lite

To update yayitswei's answer five years later...

At this point, clojure.contrib.http.agent is deprecated and clj-http is recommended instead, but it uses Apache HTTPComponents client which is no good for Google App Engine.

Anyone wanting to deploy to Google App Engine should use clj-http-lite instead.

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