From 2f18b8a33cabd0ea666781ba048d0174b4dc5031 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Sun, 1 Jun 2025 17:12:06 +0200 Subject: Initial commit --- bin/client.ml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 bin/client.ml (limited to 'bin/client.ml') diff --git a/bin/client.ml b/bin/client.ml new file mode 100644 index 0000000..17284e1 --- /dev/null +++ b/bin/client.ml @@ -0,0 +1,23 @@ +open Lwt.Syntax + +let root = "http://[::1]:8080" + +let request = + let* result = + Cohttp_handler.request ~root + (module Services_impl.Nb_car) + () { value = "foobar" } + in + match result with + | Error code -> + prerr_endline ("Got code " ^ code); + Lwt.return_unit + | Ok { value; nbcar } -> + print_endline + (String.concat " " + [ + "The number of characters for"; value; "is"; Int64.to_string nbcar; + ]); + Lwt.return_unit + +let _ = Lwt_main.run request -- cgit v1.2.3