Created
September 19, 2009 23:47
-
-
Save joewilliams/189634 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
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