如何使用 Erlang 发出 HTTPS 请求?
我尝试了 inets 库,但它超时了。我认为它不支持 HTTPS。我正在尝试使用 ibrowse,但它不起作用。
I tried the inets
library but it times out. I don't think it supports HTTPS. I am trying to use ibrowse, but it isn't working.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我来说,这适用于 Erlang/OTP 24 上的 Yaws 2.1.0 中的 get 请求(启用对等验证):
否则将会出现警告:
“真实性不是通过证书路径验证建立的”
对 更多选项请参见: https://www.erlang.org/doc/男人/httpc.html#request-4
For me this worked for a get request (with peer verification enabled) in Yaws 2.1.0 on Erlang/OTP 24:
Else there will be the warning:
"Authenticity is not established by certificate path validation"
For more options see: https://www.erlang.org/doc/man/httpc.html#request-4
在 Erlang/OTP 25: 中,这对我有用:
In Erlang/OTP 25:, this worked for me:
这对我有用:
This is what worked for me:
这对我来说效果很好:
http:request("https://example.com")
也可以,您只需在任何请求之前加载适当的应用程序即可。This works fine for me:
http:request("https://example.com")
would also work though, you just have to load appropriate applications before any request.