]> matita.cs.unibo.it Git - helm.git/commitdiff
restyled API so that respond_* are statically typechecked
authorStefano Zacchiroli <zack@upsilon.cc>
Thu, 20 May 2004 15:45:08 +0000 (15:45 +0000)
committerStefano Zacchiroli <zack@upsilon.cc>
Thu, 20 May 2004 15:45:08 +0000 (15:45 +0000)
helm/DEVEL/ocaml-http/http_daemon.mli

index 7f1e1bb46015e193a53a538186a1975f795b427d..3207261f772f2e54c5a349c1aec35217d53e3f75 100644 (file)
@@ -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