File: http_get.ml

package info (click to toggle)
netclient 0.91-10
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,096 kB
  • ctags: 1,539
  • sloc: ml: 8,808; sh: 527; makefile: 203
file content (16 lines) | stat: -rw-r--r-- 322 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#require "netclient";;

(* This example shows how to get a file from a HTTP server using
 * the Convenience module.
 *
 * Load this into the toplevel, then:
 * get_and_print "http://www.caml.org/";;
 *)

open Http_client.Convenience;;

let get_and_print url =
  let s = http_get url in
  print_string s;
  flush stdout
;;