3 OCaml HTTP - do it yourself (fully OCaml) HTTP daemon
5 Copyright (C) <2002> Stefano Zacchiroli <zack@cs.unibo.it>
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 (** Common functionalities shared by other OCaml HTTP modules *)
26 (** whether debugging messages are enabled or not, can be changed at runtime
30 (** print a string on stderr only if debugging is enabled *)
31 val debug_print: string -> unit
33 (** see {! Http_constants.version} *)
34 val http_version: version
36 (** see {! Http_constants.server_string} *)
37 val server_string: string
39 (** pretty print an HTTP version *)
40 val string_of_version: version -> string
42 (** parse an HTTP version from a string
43 @raise Invalid_HTTP_version if given string doesn't represent a supported HTTP
45 val version_of_string: string -> version
47 (** pretty print an HTTP method *)
48 val string_of_method: meth -> string
50 (** parse an HTTP method from a string
51 @raise Invalid_HTTP_method if given string doesn't represent a supported
53 val method_of_string: string -> meth
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
59 (** converts an HTTP status to the corresponding integer value *)
60 val code_of_status: [< status] -> int
62 (** @return true on "informational" status codes, false elsewhere *)
63 val is_informational: int -> bool
65 (** @return true on "success" status codes, false elsewhere *)
66 val is_success: int -> bool
68 (** @return true on "redirection" status codes, false elsewhere *)
69 val is_redirection: int -> bool
71 (** @return true on "client error" status codes, false elsewhere *)
72 val is_client_error: int -> bool
74 (** @return true on "server error" status codes, false elsewhere *)
75 val is_server_error: int -> bool
77 (** @return true on "client error" and "server error" status code, false
79 val is_error: int -> bool