]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/DEVEL/ocaml-http/examples/dump_args.ml
ocaml 3.09 transition
[helm.git] / helm / DEVEL / ocaml-http / examples / dump_args.ml
index b7cf02a86c97f332b1da0b8064512c6200d3adaa..ab082112aca95e554a1a67ac4a9442059fa137a5 100644 (file)
@@ -23,8 +23,6 @@ open Printf
 open Http_types
 
 let callback req outchan =
-  Http_daemon.send_basic_headers ~code:(`Code 200) outchan;
-  Http_daemon.send_CRLF outchan;
   let str = 
     (sprintf "request path = %s\n"  req#path) ^
     (sprintf "request GET params = %s\n"
@@ -36,9 +34,9 @@ let callback req outchan =
     (sprintf "request ALL params = %s\n"
       (String.concat ";"
         (List.map (fun (h,v) -> String.concat "=" [h;v]) req#params))) ^
-    (sprintf "request BODY = '%s'\n" req#body)
+    (sprintf "request BODY = '%s'\n\n" req#body)
   in
-  output_string outchan str
+  Http_daemon.respond ~code:(`Code 200) ~body: str outchan
 
 let spec =
   { Http_daemon.default_spec with