ssl - 如何使用 Erlang 发出 HTTPS 请求?

标签 ssl https erlang erlang-otp inets

我尝试了 inets 库,但它超时了。我认为它不支持 HTTPS。我正在尝试使用 ibrowse,但它不起作用。

最佳答案

这对我来说很好:

1> application:start(inets).
ok
2> application:start(ssl).  
ok
3> http:request(head, {"https://example.com", []}, [{ssl,[{verify,0}]}], []).
{ok,{{"HTTP/1.1",200,"OK"},
     [{"cache-control","max-age=0, proxy-revalidate"},
      {"date","Sun, 23 May 2010 00:38:33 GMT"},
      {"server","BAIDA/1.0.0"},
      {"content-type","text/html; charset=windows-1251"},
      {"expires","Sun, 23 May 2010 00:38:33 GMT"},
      {"set-cookie",
       "uid=9041986921274575113; domain=.example.com; path=/; expires=Tue, 19 Jan 2038 03:14:07 GMT"}],
     []}}

http:request("https://example.com") 也可以,您只需在任何请求之前加载适当的应用程序即可。

关于ssl - 如何使用 Erlang 发出 HTTPS 请求?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2886521/

相关文章:

amazon-web-services - 如何在aws elb上安装godaddy ssl证书?

perl - 安装 Perl 模块 LWP::Protocol::https

security - 通过 HTTP 强制使用 HTTPS

Erlang:新的实用程序函数,可从已知的记录集中获取记录的字段名称

erlang - 为什么 simple_one_for_one 工作人员可以共享相同的子规范 ID?

erlang - Erlang 是网络爬虫的正确选择吗?

internet-explorer - 旧浏览器 TLS 1.0 和 1.1

node.js - NGINX 不路由 https 请求

c# - Windows 10 + 请求被中止 : Could not create SSL/TLS secure channel

java - Heroku 上的 jetty : how to tell in code if https was used