]> matita.cs.unibo.it Git - helm.git/blob - helm/DEVEL/ocaml-http/http_common.mli
ocaml 3.09 transition
[helm.git] / helm / DEVEL / ocaml-http / http_common.mli
1
2 (*
3   OCaml HTTP - do it yourself (fully OCaml) HTTP daemon
4
5   Copyright (C) <2002-2005> Stefano Zacchiroli <zack@cs.unibo.it>
6
7   This program is free software; you can redistribute it and/or modify
8   it under the terms of the GNU Library General Public License as
9   published by the Free Software Foundation, version 2.
10
11   This program is distributed in the hope that it will be useful,
12   but WITHOUT ANY WARRANTY; without even the implied warranty of
13   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   GNU Library General Public License for more details.
15
16   You should have received a copy of the GNU Library General Public
17   License along with this program; if not, write to the Free Software
18   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
19   USA
20 *)
21
22 (** Common functionalities shared by other OCaml HTTP modules *)
23
24 open Http_types;;
25
26   (** whether debugging messages are enabled or not, can be changed at runtime
27   *)
28 val debug: bool ref
29
30   (** print a string on stderr only if debugging is enabled *)
31 val debug_print: string -> unit
32
33   (** see {!Http_constants.version} *)
34 val http_version: version
35
36   (** see {!Http_constants.server_string} *)
37 val server_string: string
38
39   (** pretty print an HTTP version *)
40 val string_of_version: version -> string
41
42   (** parse an HTTP version from a string
43   @raise Invalid_HTTP_version if given string doesn't represent a supported HTTP
44   version *)
45 val version_of_string: string -> version
46
47   (** pretty print an HTTP method *)
48 val string_of_method: meth -> string
49
50   (** parse an HTTP method from a string
51   @raise Invalid_HTTP_method if given string doesn't represent a supported
52   method *)
53 val method_of_string: string -> meth
54
55   (** converts an integer HTTP status to the corresponding status value
56   @raise Invalid_code if given integer isn't a valid HTTP status code *)
57 val status_of_code: int -> status
58
59   (** converts an HTTP status to the corresponding integer value *)
60 val code_of_status: [< status] -> int
61
62   (** @return true on "informational" status codes, false elsewhere *)
63 val is_informational: int -> bool
64
65   (** @return true on "success" status codes, false elsewhere *)
66 val is_success: int -> bool
67
68   (** @return true on "redirection" status codes, false elsewhere *)
69 val is_redirection: int -> bool
70
71   (** @return true on "client error" status codes, false elsewhere *)
72 val is_client_error: int -> bool
73
74   (** @return true on "server error" status codes, false elsewhere *)
75 val is_server_error: int -> bool
76
77   (** @return true on "client error" and "server error" status code, false
78   elsewhere *)
79 val is_error: int -> bool
80