* 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_client.http_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_client.http_get uri
with
- e -> raise (HttpClientError (e,uri))
+ e -> raise (HttpClientError (Printexc.to_string e, uri))
;;
let get_and_save uri dest_filename =
done ;
cs
in
- let tmp_file = Configuration.tmp_dir ^ "/" ^ (flat_string uri ".-=:;!?/&" '_') in
+ let user = try Unix.getlogin () with _ -> "" in
+ let tmp_file =
+ Filename.temp_file (user ^ flat_string uri ".-=:;!?/&" '_') ""
+ in
get_and_save uri tmp_file ;
tmp_file
;;
+