File: http_download.ml

package info (click to toggle)
ocamlnet 2.2.9-8
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 17,724 kB
  • ctags: 10,053
  • sloc: ml: 63,928; ansic: 1,973; makefile: 800; sh: 651
file content (11 lines) | stat: -rw-r--r-- 266 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
(* This example downloads a URL into a file *)

open Http_client

let download url =
  let pipeline = new pipeline in
  let get_call = new get url in
  get_call # set_response_body_storage (`File (fun () -> "file"));
  pipeline # add get_call;
  pipeline # run()
;;