Skip to content

Instantly share code, notes, and snippets.

@joewilliams
Created September 19, 2009 23:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save joewilliams/189634 to your computer and use it in GitHub Desktop.
Save joewilliams/189634 to your computer and use it in GitHub Desktop.
(*
to compile:
$ ocamlfind ocamlopt -o print_http_json print_http_json.ml -linkpkg -package json-static,netclient -syntax camlp4o
to run (trying it out on couchdb):
$ ./print_http_json http://localhost:5984/joetest
*)
open Printf
let get url =
(Json_io.json_of_string
(Http_client.Convenience.http_get url ))
let print json =
printf "%s\n%!"
(Json_io.string_of_json ~compact:false json)
let _ =
print (get(Sys.argv.(1)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment