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"
(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