Source

ocaml-bitbucket / xcurl.ml

1
2
3
4
5
6
7
8
let get_string f = 
  let h = new Curl.handle in
  f h;
  let buf = Buffer.create 100 in
  h#set_writefunction (fun s -> Buffer.add_string buf s; String.length s);
  h#perform;
  h#get_httpcode, Buffer.contents buf