From: Stefano Zacchiroli Date: Thu, 20 May 2004 15:45:08 +0000 (+0000) Subject: restyled API so that respond_* are statically typechecked X-Git-Tag: V_0_0_9~25 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=ba3224fbc6895b321f80a45b472a7433722daf2b;p=helm.git restyled API so that respond_* are statically typechecked --- diff --git a/helm/DEVEL/ocaml-http/http_daemon.mli b/helm/DEVEL/ocaml-http/http_daemon.mli index 7f1e1bb46..3207261f7 100644 --- a/helm/DEVEL/ocaml-http/http_daemon.mli +++ b/helm/DEVEL/ocaml-http/http_daemon.mli @@ -32,14 +32,14 @@ val send_CRLF: out_channel -> unit either code or status must be given (not both, not none) which represent the HTTP response code, outchan is the output channel to which send status line *) val send_status_line: - ?version: Http_types.version -> ?code: int -> ?status: Http_types.status -> + ?version:Http_types.version -> code:Http_types.status_code -> out_channel -> unit (** like send_status_line but additionally will also send "Date" and "Server" standard headers *) val send_basic_headers: - ?version: Http_types.version -> ?code: int -> ?status: Http_types.status -> + ?version: Http_types.version -> code:Http_types.status_code -> out_channel -> unit @@ -63,7 +63,7 @@ val send_file: src:Http_types.file_source -> out_channel -> unit status is 200, default response HTTP version is Http_common.http_version *) val respond: ?body:string -> ?headers:(string * string) list -> - ?version:Http_types.version -> ?code:int -> ?status:Http_types.status -> + ?version:Http_types.version -> code:Http_types.status_code -> out_channel -> unit @@ -77,12 +77,11 @@ val respond_forbidden: (** send a "redirection" class response, optional body argument contains data that will be displayed in the body of the response, default response status is - 302 (moved permanently), only redirection status are accepted by this + 301 (moved permanently), only redirection status are accepted by this function, other values will raise Failure *) val respond_redirect: location:string -> ?body:string -> - ?version: Http_types.version -> - ?code: int -> ?status: Http_types.redirection_status -> + ?version: Http_types.version -> ?code:Http_types.status_code -> out_channel -> unit @@ -97,8 +96,7 @@ val respond_unauthorized: raise Failure *) val respond_error: ?body:string -> - ?version: Http_types.version -> - ?code: int -> ?status: Http_types.error_status -> + ?version: Http_types.version -> ?code:Http_types.status_code -> out_channel -> unit