From 1cce509397545ce69cfd39b24f5711eb9aecb62b Mon Sep 17 00:00:00 2001 From: Kaustubh Maske Patil <37668193+nikochiko@users.noreply.github.com> Date: Thu, 8 May 2025 12:27:28 +0530 Subject: [PATCH] add post request handler --- bin/nikodream.ml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/nikodream.ml b/bin/nikodream.ml index a36ae3d..cb44a3a 100644 --- a/bin/nikodream.ml +++ b/bin/nikodream.ml @@ -26,4 +26,9 @@ let () = !successful !failed)); Dream.get "/echo/:word" (fun request -> Dream.html (Dream.param request "word")); + Dream.post "/echo" (fun request -> + let* body = Dream.body request in + Dream.respond + ~headers:[ ("Content-Type", "application/octet-stream") ] + body); ]