Orada lwt kullanarak olasılıklar şunlardır:
$ opam install ocsigenserver cohttp
Bir toplevel Mesela
:
try Topdirs.dir_directory (Sys.getenv "OCAML_TOPLEVEL_PATH") with _ ->();;
#use "topfind";;
#thread;;
#require "ocsigenserver";;
open Lwt
(* a simple function to access the content of the response *)
let content = function
| { Ocsigen_http_frame.frame_content = Some v } ->
Ocsigen_stream.string_of_stream 100000 (Ocsigen_stream.get v)
| _ -> return ""
(* launch both requests in parallel *)
let t = Lwt_list.map_p Ocsigen_http_client.get_url
[ "http://ocsigen.org/";
"http://stackoverflow.com/" ]
(* maps the result through the content function *)
let t2 = t >>= Lwt_list.map_p content
(* launch the event loop *)
let result = Lwt_main.run t2
ve kullanma cohttp:
Jane sokak zaman uyumsuz kitaplığı için cohttp bir uygulamasıdır da Sadece kayıt için
'Ocamlnet' http://projects.camlcity.org/projects/ocamlnet.html –
@BasileStarynkevitch'i düşündüğünüz oldu Gerçekten, ben yeni bir öğrenenim ve hiçbir şey bilmiyorum. Ocamlnet en iyisi mi? –
En iyisi olup olmadığını bilmiyorum, ama çok iyi. –