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 type version = [ `HTTP_1_0 | `HTTP_1_1 ]
26 and informational_substatus = [ `Continue | `Switching_protocols ]
28 and success_substatus =
32 | `Non_authoritative_information
38 and redirection_substatus =
48 and client_error_substatus =
59 | `Precondition_failed
60 | `Proxy_authentication_required
61 | `Request_URI_too_large
62 | `Request_entity_too_large
64 | `Requested_range_not_satisfiable
66 | `Unsupported_media_type
69 and server_error_substatus =
72 | `HTTP_version_not_supported
73 | `Internal_server_error
75 | `Service_unavailable
78 and informational_status = [ `Informational of informational_substatus ]
79 and success_status = [ `Success of success_substatus ]
80 and redirection_status = [ `Redirection of redirection_substatus ]
81 and client_error_status = [ `Client_error of client_error_substatus ]
82 and server_error_status = [ `Server_error of server_error_substatus ]
85 [ `Client_error of client_error_substatus
86 | `Server_error of server_error_substatus
90 [ `Client_error of client_error_substatus
91 | `Informational of informational_substatus
92 | `Redirection of redirection_substatus
93 | `Server_error of server_error_substatus
94 | `Success of success_substatus
99 method addContents : string -> unit
100 method addContentsBuf : Buffer.t -> unit
101 method addHeader : name:string -> value:string -> unit
103 method contentEncoding : string
104 method contentType : string
105 method contents : string
106 method contentsBuf : Buffer.t
108 method expires : string
109 method hasHeader : name:string -> bool
110 method header : name:string -> string
111 method headers : (string * string) list
112 method isClientError : bool
113 method isError : bool
114 method isInformational : bool
115 method isRedirection : bool
116 method isServerError : bool
117 method isSuccess : bool
118 method reason : string
119 method removeHeader : name:string -> unit
120 method replaceHeader : name:string -> value:string -> unit
121 method serialize : out_channel -> unit
122 method server : string
123 method setCode : int -> unit
124 method setContentEncoding : string -> unit
125 method setContentType : string -> unit
126 method setContents : string -> unit
127 method setContentsBuf : Buffer.t -> unit
128 method setDate : string -> unit
129 method setExpires : string -> unit
130 method setReason : string -> unit
131 method setServer : string -> unit
132 method setStatus : status -> unit
133 method setStatusLine : string -> unit
134 method setVersion : version -> unit
135 method status : status
136 method statusLine : string
137 method version : version
144 method param: string -> string
145 method params: (string * string) list