2010-05-22 20 views
20

Probé la biblioteca inets pero agota el tiempo. No creo que sea compatible con HTTPS. Estoy tratando de usar ibrowse, pero no está funcionando.¿Cómo hago una solicitud HTTPS con Erlang?

+4

"No funciona?" Publica tus errores! Publica tu código! –

Respuesta

28

Esto funciona muy bien para mí:

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") también funcionaría sin embargo, sólo hay que cargar aplicaciones apropiadas antes de que cualquier petición.

+3

ahhh ... Tenía que star ssl – gersh

Cuestiones relacionadas