let return_html = mk_return_fun "text/html"
let return_xml = mk_return_fun "text/xml"
-let return_400 body ch = Http_daemon.respond_error ~code:400 ~body ch
+let return_400 body ch =
+ Http_daemon.respond_error ~code:(`Code 400) ~body ch
let return_html_error s = return_html ("<html><body>" ^ s ^ "</body></html>")
let get_option key =
| s -> return_html_error ("unsupported kind: " ^ s) ch
end ;
M.disconnect db
- | invalid_request -> Http_daemon.respond_error ~status:(`Client_error `Bad_request) ch)
+ | invalid_request ->
+ Http_daemon.respond_error ~code:(`Status (`Client_error `Bad_request))
+ ch)
with
| Http_types.Param_not_found attr_name ->
return_400 (Printf.sprintf "Parameter '%s' is missing" attr_name) ch