]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/getter/clientHTTP.ml
debian: rebuilt against ocaml 3.08.3
[helm.git] / helm / ocaml / getter / clientHTTP.ml
index 2444bded35afc1eab918c5a118b477f4a8be5bd4..b4e0e26b67e65194375f02749e1aa2de074fad10 100644 (file)
  * http://cs.unibo.it/helm/.
  *)
 
-exception HttpClientError of exn * string;;
+exception HttpClientError of string * string;; (* reason, uri *)
 
 let send cmd =
  try
-  ignore (Http_client.Convenience.http_get cmd)
+  ignore (Http_user_agent.get cmd)
  with
-  e -> raise (HttpClientError (e,cmd))
+  e -> raise (HttpClientError (Printexc.to_string e, cmd))
 ;;
 
 let get uri =
  try
-  Http_client.Convenience.http_get uri
+  Http_user_agent.get uri
  with
-  e -> raise (HttpClientError (e,uri))
+  e -> raise (HttpClientError (Printexc.to_string e, uri))
 ;;
 
 let get_and_save uri dest_filename =
- let reply = get uri
- and out_channel = open_out dest_filename in
-  output_string out_channel reply ;
-  close_out out_channel
+ let out_channel = open_out dest_filename in
+ Http_user_agent.get_iter (output_string out_channel) uri;
+ close_out out_channel
 ;;
 
 let get_and_save_to_tmp uri =