diff --git a/lib/net.ml b/lib/net.ml index 7023dc7..78cadae 100644 --- a/lib/net.ml +++ b/lib/net.ml @@ -5,5 +5,10 @@ let send_post_request url json = let headers = Cohttp.Header.init_with "Content-Type" "application/json" in let body = Cohttp_lwt.Body.of_string json in Lwt.bind (Client.post ~headers ~body uri) (fun (_response, body) -> - (* Lwt.map (fun body_str -> response, body_str) *) Cohttp_lwt.Body.to_string body) + Cohttp_lwt.Body.to_string body) +;; + +let execute_request url json = + let body = send_post_request url json in + Lwt_main.run body ;;