2010-05-22 103 views
20

我試過inets庫,但超時。我不認爲它支持HTTPS。我正在嘗試使用ibrowse,但它不起作用。如何使用Erlang進行HTTPS請求?

+4

「它不工作?」發佈您的錯誤!發佈您的代碼! – 2010-05-22 01:29:32

回答

28

也能正常工作對我來說:

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")也將工作,雖然,你只要有任何要求之前加載相應的應用程序。

+3

ahhh ...我不得不明星ssl – gersh 2010-05-22 03:50:19

相關問題