~ubuntu-branches/ubuntu/trusty/ocamlnet/trusty

« back to all changes in this revision

Viewing changes to doc/html-main/Nethttpd_types.html

  • Committer: Bazaar Package Importer
  • Author(s): Stéphane Glondu
  • Date: 2011-09-02 14:12:33 UTC
  • mfrom: (18.2.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110902141233-zbj0ygxb92u6gy4z
Tags: 3.4-1
* New upstream release
  - add a new NetcgiRequire directive to ease dependency management
    (Closes: #637147)
  - remove patches that were applied upstream:
    + Added-missing-shebang-lines-in-example-shell-scripts
    + Try-also-ocamlc-for-POSIX-threads

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
<link rel="stylesheet" href="style.css" type="text/css">
5
5
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
6
6
<link rel="Start" href="index.html">
7
 
<link rel="previous" href="Ftp_client.html">
 
7
<link rel="previous" href="Netgssapi.html">
8
8
<link rel="next" href="Nethttpd_kernel.html">
9
9
<link rel="Up" href="index.html">
10
10
<link title="Index of types" rel=Appendix href="index_types.html">
17
17
<link title="Index of modules" rel=Appendix href="index_modules.html">
18
18
<link title="Index of module types" rel=Appendix href="index_module_types.html">
19
19
<link title="Uq_gtk" rel="Chapter" href="Uq_gtk.html">
 
20
<link title="Uq_ssl" rel="Chapter" href="Uq_ssl.html">
 
21
<link title="Https_client" rel="Chapter" href="Https_client.html">
 
22
<link title="Uq_tcl" rel="Chapter" href="Uq_tcl.html">
20
23
<link title="Equeue" rel="Chapter" href="Equeue.html">
21
24
<link title="Unixqueue" rel="Chapter" href="Unixqueue.html">
 
25
<link title="Unixqueue_pollset" rel="Chapter" href="Unixqueue_pollset.html">
 
26
<link title="Unixqueue_select" rel="Chapter" href="Unixqueue_select.html">
 
27
<link title="Uq_resolver" rel="Chapter" href="Uq_resolver.html">
22
28
<link title="Uq_engines" rel="Chapter" href="Uq_engines.html">
23
29
<link title="Uq_socks5" rel="Chapter" href="Uq_socks5.html">
24
 
<link title="Unixqueue_mt" rel="Chapter" href="Unixqueue_mt.html">
 
30
<link title="Uq_io" rel="Chapter" href="Uq_io.html">
 
31
<link title="Uq_lwt" rel="Chapter" href="Uq_lwt.html">
 
32
<link title="Uq_libevent" rel="Chapter" href="Uq_libevent.html">
25
33
<link title="Equeue_intro" rel="Chapter" href="Equeue_intro.html">
26
 
<link title="Uq_ssl" rel="Chapter" href="Uq_ssl.html">
27
 
<link title="Uq_tcl" rel="Chapter" href="Uq_tcl.html">
 
34
<link title="Netcamlbox" rel="Chapter" href="Netcamlbox.html">
 
35
<link title="Netcgi_apache" rel="Chapter" href="Netcgi_apache.html">
 
36
<link title="Netcgi_modtpl" rel="Chapter" href="Netcgi_modtpl.html">
 
37
<link title="Netcgi_plex" rel="Chapter" href="Netcgi_plex.html">
28
38
<link title="Netcgi_common" rel="Chapter" href="Netcgi_common.html">
29
39
<link title="Netcgi" rel="Chapter" href="Netcgi.html">
30
40
<link title="Netcgi_ajp" rel="Chapter" href="Netcgi_ajp.html">
35
45
<link title="Netcgi1_compat" rel="Chapter" href="Netcgi1_compat.html">
36
46
<link title="Netcgi_test" rel="Chapter" href="Netcgi_test.html">
37
47
<link title="Netcgi_porting" rel="Chapter" href="Netcgi_porting.html">
38
 
<link title="Netcgi_plex" rel="Chapter" href="Netcgi_plex.html">
 
48
<link title="Http_client_conncache" rel="Chapter" href="Http_client_conncache.html">
39
49
<link title="Http_client" rel="Chapter" href="Http_client.html">
40
50
<link title="Telnet_client" rel="Chapter" href="Telnet_client.html">
41
51
<link title="Ftp_data_endpoint" rel="Chapter" href="Ftp_data_endpoint.html">
42
52
<link title="Ftp_client" rel="Chapter" href="Ftp_client.html">
 
53
<link title="Http_fs" rel="Chapter" href="Http_fs.html">
 
54
<link title="Ftp_fs" rel="Chapter" href="Ftp_fs.html">
 
55
<link title="Netclient_tut" rel="Chapter" href="Netclient_tut.html">
 
56
<link title="Netgssapi" rel="Chapter" href="Netgssapi.html">
43
57
<link title="Nethttpd_types" rel="Chapter" href="Nethttpd_types.html">
44
58
<link title="Nethttpd_kernel" rel="Chapter" href="Nethttpd_kernel.html">
45
59
<link title="Nethttpd_reactor" rel="Chapter" href="Nethttpd_reactor.html">
46
60
<link title="Nethttpd_engine" rel="Chapter" href="Nethttpd_engine.html">
47
61
<link title="Nethttpd_services" rel="Chapter" href="Nethttpd_services.html">
48
62
<link title="Nethttpd_plex" rel="Chapter" href="Nethttpd_plex.html">
 
63
<link title="Nethttpd_util" rel="Chapter" href="Nethttpd_util.html">
49
64
<link title="Nethttpd_intro" rel="Chapter" href="Nethttpd_intro.html">
 
65
<link title="Netmech_scram" rel="Chapter" href="Netmech_scram.html">
 
66
<link title="Netmech_scram_gssapi" rel="Chapter" href="Netmech_scram_gssapi.html">
 
67
<link title="Netmcore" rel="Chapter" href="Netmcore.html">
 
68
<link title="Netmcore_camlbox" rel="Chapter" href="Netmcore_camlbox.html">
 
69
<link title="Netmcore_mempool" rel="Chapter" href="Netmcore_mempool.html">
 
70
<link title="Netmcore_heap" rel="Chapter" href="Netmcore_heap.html">
 
71
<link title="Netmcore_ref" rel="Chapter" href="Netmcore_ref.html">
 
72
<link title="Netmcore_array" rel="Chapter" href="Netmcore_array.html">
 
73
<link title="Netmcore_sem" rel="Chapter" href="Netmcore_sem.html">
 
74
<link title="Netmcore_mutex" rel="Chapter" href="Netmcore_mutex.html">
 
75
<link title="Netmcore_condition" rel="Chapter" href="Netmcore_condition.html">
 
76
<link title="Netmcore_queue" rel="Chapter" href="Netmcore_queue.html">
 
77
<link title="Netmcore_buffer" rel="Chapter" href="Netmcore_buffer.html">
 
78
<link title="Netmcore_matrix" rel="Chapter" href="Netmcore_matrix.html">
 
79
<link title="Netmcore_hashtbl" rel="Chapter" href="Netmcore_hashtbl.html">
 
80
<link title="Netmcore_process" rel="Chapter" href="Netmcore_process.html">
 
81
<link title="Netmcore_tut" rel="Chapter" href="Netmcore_tut.html">
50
82
<link title="Netplex_types" rel="Chapter" href="Netplex_types.html">
51
83
<link title="Netplex_mp" rel="Chapter" href="Netplex_mp.html">
52
84
<link title="Netplex_mt" rel="Chapter" href="Netplex_mt.html">
60
92
<link title="Netplex_kit" rel="Chapter" href="Netplex_kit.html">
61
93
<link title="Rpc_netplex" rel="Chapter" href="Rpc_netplex.html">
62
94
<link title="Netplex_cenv" rel="Chapter" href="Netplex_cenv.html">
 
95
<link title="Netplex_semaphore" rel="Chapter" href="Netplex_semaphore.html">
 
96
<link title="Netplex_sharedvar" rel="Chapter" href="Netplex_sharedvar.html">
 
97
<link title="Netplex_mutex" rel="Chapter" href="Netplex_mutex.html">
 
98
<link title="Netplex_encap" rel="Chapter" href="Netplex_encap.html">
63
99
<link title="Netplex_intro" rel="Chapter" href="Netplex_intro.html">
 
100
<link title="Netplex_advanced" rel="Chapter" href="Netplex_advanced.html">
 
101
<link title="Netplex_admin" rel="Chapter" href="Netplex_admin.html">
64
102
<link title="Netshm" rel="Chapter" href="Netshm.html">
65
103
<link title="Netshm_data" rel="Chapter" href="Netshm_data.html">
66
104
<link title="Netshm_hashtbl" rel="Chapter" href="Netshm_hashtbl.html">
83
121
<link title="Nethtml" rel="Chapter" href="Nethtml.html">
84
122
<link title="Netstring_str" rel="Chapter" href="Netstring_str.html">
85
123
<link title="Netstring_pcre" rel="Chapter" href="Netstring_pcre.html">
86
 
<link title="Netstring_mt" rel="Chapter" href="Netstring_mt.html">
87
124
<link title="Netmappings" rel="Chapter" href="Netmappings.html">
88
125
<link title="Netaux" rel="Chapter" href="Netaux.html">
89
126
<link title="Nethttp" rel="Chapter" href="Nethttp.html">
 
127
<link title="Netpagebuffer" rel="Chapter" href="Netpagebuffer.html">
 
128
<link title="Netfs" rel="Chapter" href="Netfs.html">
 
129
<link title="Netglob" rel="Chapter" href="Netglob.html">
 
130
<link title="Netauth" rel="Chapter" href="Netauth.html">
 
131
<link title="Netsockaddr" rel="Chapter" href="Netsockaddr.html">
 
132
<link title="Netnumber" rel="Chapter" href="Netnumber.html">
 
133
<link title="Rtypes" rel="Chapter" href="Rtypes.html">
 
134
<link title="Xdr_mstring" rel="Chapter" href="Xdr_mstring.html">
 
135
<link title="Xdr" rel="Chapter" href="Xdr.html">
 
136
<link title="Netcompression" rel="Chapter" href="Netcompression.html">
90
137
<link title="Netchannels_tut" rel="Chapter" href="Netchannels_tut.html">
91
138
<link title="Netmime_tut" rel="Chapter" href="Netmime_tut.html">
92
139
<link title="Netsendmail_tut" rel="Chapter" href="Netsendmail_tut.html">
93
140
<link title="Netulex_tut" rel="Chapter" href="Netulex_tut.html">
94
141
<link title="Neturl_tut" rel="Chapter" href="Neturl_tut.html">
95
142
<link title="Netsys" rel="Chapter" href="Netsys.html">
 
143
<link title="Netsys_posix" rel="Chapter" href="Netsys_posix.html">
 
144
<link title="Netsys_pollset" rel="Chapter" href="Netsys_pollset.html">
 
145
<link title="Netlog" rel="Chapter" href="Netlog.html">
 
146
<link title="Netexn" rel="Chapter" href="Netexn.html">
 
147
<link title="Netsys_win32" rel="Chapter" href="Netsys_win32.html">
 
148
<link title="Netsys_pollset_posix" rel="Chapter" href="Netsys_pollset_posix.html">
 
149
<link title="Netsys_pollset_win32" rel="Chapter" href="Netsys_pollset_win32.html">
 
150
<link title="Netsys_pollset_generic" rel="Chapter" href="Netsys_pollset_generic.html">
 
151
<link title="Netsys_signal" rel="Chapter" href="Netsys_signal.html">
 
152
<link title="Netsys_oothr" rel="Chapter" href="Netsys_oothr.html">
 
153
<link title="Netsys_xdr" rel="Chapter" href="Netsys_xdr.html">
 
154
<link title="Netsys_rng" rel="Chapter" href="Netsys_rng.html">
 
155
<link title="Netsys_types" rel="Chapter" href="Netsys_types.html">
 
156
<link title="Netsys_mem" rel="Chapter" href="Netsys_mem.html">
 
157
<link title="Netsys_tmp" rel="Chapter" href="Netsys_tmp.html">
 
158
<link title="Netgzip" rel="Chapter" href="Netgzip.html">
96
159
<link title="Netpop" rel="Chapter" href="Netpop.html">
97
160
<link title="Rpc_auth_dh" rel="Chapter" href="Rpc_auth_dh.html">
98
161
<link title="Rpc_key_service" rel="Chapter" href="Rpc_key_service.html">
99
162
<link title="Rpc_time" rel="Chapter" href="Rpc_time.html">
100
163
<link title="Rpc_auth_local" rel="Chapter" href="Rpc_auth_local.html">
101
 
<link title="Rtypes" rel="Chapter" href="Rtypes.html">
102
 
<link title="Xdr" rel="Chapter" href="Xdr.html">
 
164
<link title="Rpc_ssl" rel="Chapter" href="Rpc_ssl.html">
 
165
<link title="Rpc_xti_client" rel="Chapter" href="Rpc_xti_client.html">
103
166
<link title="Rpc" rel="Chapter" href="Rpc.html">
104
167
<link title="Rpc_program" rel="Chapter" href="Rpc_program.html">
 
168
<link title="Rpc_util" rel="Chapter" href="Rpc_util.html">
105
169
<link title="Rpc_portmapper_aux" rel="Chapter" href="Rpc_portmapper_aux.html">
106
170
<link title="Rpc_packer" rel="Chapter" href="Rpc_packer.html">
107
171
<link title="Rpc_transport" rel="Chapter" href="Rpc_transport.html">
111
175
<link title="Rpc_portmapper" rel="Chapter" href="Rpc_portmapper.html">
112
176
<link title="Rpc_server" rel="Chapter" href="Rpc_server.html">
113
177
<link title="Rpc_auth_sys" rel="Chapter" href="Rpc_auth_sys.html">
 
178
<link title="Rpc_auth_gssapi" rel="Chapter" href="Rpc_auth_gssapi.html">
 
179
<link title="Rpc_proxy" rel="Chapter" href="Rpc_proxy.html">
114
180
<link title="Rpc_intro" rel="Chapter" href="Rpc_intro.html">
115
181
<link title="Rpc_mapping_ref" rel="Chapter" href="Rpc_mapping_ref.html">
116
 
<link title="Rpc_ssl" rel="Chapter" href="Rpc_ssl.html">
117
 
<link title="Rpc_xti_client" rel="Chapter" href="Rpc_xti_client.html">
 
182
<link title="Rpc_intro_gss" rel="Chapter" href="Rpc_intro_gss.html">
118
183
<link title="Shell_sys" rel="Chapter" href="Shell_sys.html">
119
184
<link title="Shell" rel="Chapter" href="Shell.html">
120
185
<link title="Shell_uq" rel="Chapter" href="Shell_uq.html">
121
 
<link title="Shell_mt" rel="Chapter" href="Shell_mt.html">
 
186
<link title="Shell_fs" rel="Chapter" href="Shell_fs.html">
122
187
<link title="Shell_intro" rel="Chapter" href="Shell_intro.html">
123
 
<link title="Netsmtp" rel="Chapter" href="Netsmtp.html"><link title="Exceptions" rel="Section" href="#exceptions">
 
188
<link title="Netsmtp" rel="Chapter" href="Netsmtp.html">
 
189
<link title="Intro" rel="Chapter" href="Intro.html">
 
190
<link title="Platform" rel="Chapter" href="Platform.html">
 
191
<link title="Foreword" rel="Chapter" href="Foreword.html">
 
192
<link title="Ipv6" rel="Chapter" href="Ipv6.html"><link title="Exceptions" rel="Section" href="#exceptions">
124
193
<link title="Environment" rel="Section" href="#environment">
 
194
<link title="Generating error responses, logging" rel="Section" href="#1_Generatingerrorresponseslogging">
125
195
<link title="Service Providers" rel="Section" href="#service">
126
196
<link title="Helpers" rel="Section" href="#helpers">
127
197
<link title="Construction of environments" rel="Subsection" href="#2_Constructionofenvironments">
128
198
<link title="Auxiliary Functions for Environments" rel="Subsection" href="#2_AuxiliaryFunctionsforEnvironments">
129
 
<title>Ocamlnet 2 Reference Manual : Nethttpd_types</title>
 
199
<title>Ocamlnet 3 Reference Manual : Nethttpd_types</title>
130
200
</head>
131
201
<body>
132
 
<div class="navbar"><a href="Ftp_client.html">Previous</a>
 
202
<div class="navbar"><a href="Netgssapi.html">Previous</a>
133
203
&nbsp;<a href="index.html">Up</a>
134
204
&nbsp;<a href="Nethttpd_kernel.html">Next</a>
135
205
</div>
152
222
Many types can also be found in the <code class="code">Nethttp</code> module (part of netstring).
153
223
 Furthermore, <code class="code">Netcgi_env</code> and <code class="code">Netcgi_types</code> are of interest (part of cgi).<br>
154
224
<br>
155
 
<a name="exceptions"></a>
156
 
<h1>Exceptions</h1><br>
157
 
<pre><span class="keyword">exception</span> <a name="EXCEPTIONStandard_response"></a>Standard_response <span class="keyword">of</span> <code class="type"><a href="Nethttp.html#TYPEhttp_status">Nethttp.http_status</a> * <a href="Nethttp.http_header.html">Nethttp.http_header</a> option * string option</code></pre>
 
225
<span id="exceptions"><h1>Exceptions</h1></span><br>
 
226
<pre><span id="EXCEPTIONStandard_response"><span class="keyword">exception</span> Standard_response</span> <span class="keyword">of</span> <code class="type"><a href="Nethttp.html#TYPEhttp_status">Nethttp.http_status</a> * <a href="Nethttp.http_header-c.html">Nethttp.http_header</a> option * string option</code></pre>
158
227
<div class="info">
159
228
Some HTTP containers allow you to raise this exception. The standard
160
229
 response corresponding to <code class="code">http_status</code> is sent back to the client.
162
231
 is written.<br>
163
232
</div>
164
233
<br>
165
 
<a name="environment"></a>
166
 
<h1>Environment</h1><br>
167
 
<pre><span class="keyword">class type</span> <a name="TYPEv_extended_environment"></a><span class="keyword">virtual</span> <a href="Nethttpd_types.v_extended_environment.html">v_extended_environment</a> = <code class="code">object</code> <a href="Nethttpd_types.v_extended_environment.html">..</a> <code class="code">end</code></pre><div class="info">
 
234
<span id="environment"><h1>Environment</h1></span><br>
 
235
<pre><span id="TYPEoutput_state"><span class="keyword">type</span> <code class="type"></code>output_state</span> = <code class="type">[ `End | `Sending | `Start ]</code> </pre>
 
236
 
 
237
<pre><span id="VALstring_of_output_state"><span class="keyword">val</span> string_of_output_state</span> : <code class="type"><a href="Nethttpd_types.html#TYPEoutput_state">output_state</a> -> string</code></pre><div class="info">
 
238
Debugging<br>
 
239
</div>
 
240
<pre><span id="TYPEv_extended_environment"><span class="keyword">class type</span> <span class="keyword">virtual</span> <a href="Nethttpd_types.v_extended_environment-c.html">v_extended_environment</a></span> = <code class="code">object</code> <a href="Nethttpd_types.v_extended_environment-c.html">..</a> <code class="code">end</code></pre><div class="info">
168
241
An extension of <code class="code">cgi_environment</code> for use with the daemon.
169
242
</div>
170
 
<pre><span class="keyword">class type</span> <a name="TYPEextended_environment"></a><a href="Nethttpd_types.extended_environment.html">extended_environment</a> = <code class="code">object</code> <a href="Nethttpd_types.extended_environment.html">..</a> <code class="code">end</code></pre><div class="info">
 
243
<pre><span id="TYPEextended_environment"><span class="keyword">class type</span> <a href="Nethttpd_types.extended_environment-c.html">extended_environment</a></span> = <code class="code">object</code> <a href="Nethttpd_types.extended_environment-c.html">..</a> <code class="code">end</code></pre><div class="info">
171
244
Same as <code class="code">v_extended_environment</code>, but no virtual methods
172
245
</div>
173
246
<br>
174
 
<a name="2_Constructionofenvironments"></a>
175
 
<h2>Construction of environments</h2><br>
176
 
<pre><span class="keyword">class</span> <a name="TYPEempty_environment"></a><span class="keyword">virtual</span> <a href="Nethttpd_types.empty_environment.html">empty_environment</a> : <code class="type"></code><code class="code">object</code> <a href="Nethttpd_types.empty_environment.html">..</a> <code class="code">end</code></pre><div class="info">
 
247
<span id="2_Constructionofenvironments"><h2>Construction of environments</h2></span><br>
 
248
<pre><span name="TYPEempty_environment"><span class="keyword">class</span> <span class="keyword">virtual</span> <a href="Nethttpd_types.empty_environment-c.html">empty_environment</a></span> : <code class="type"></code><code class="code">object</code> <a href="Nethttpd_types.empty_environment-c.html">..</a> <code class="code">end</code></pre><div class="info">
177
249
This class implements an environment with defined internal containers.
178
250
</div>
179
 
<pre><span class="keyword">class</span> <a name="TYPEredirected_environment"></a><a href="Nethttpd_types.redirected_environment.html">redirected_environment</a> : <code class="type">?in_state:<a href="Netcgi1_compat.Netcgi_env.html#TYPEinput_state">Netcgi1_compat.Netcgi_env.input_state</a> -> ?in_header:<a href="Nethttp.http_header.html">Nethttp.http_header</a> -> ?properties:(string * string) list -> ?in_channel:<a href="Netchannels.in_obj_channel.html">Netchannels.in_obj_channel</a> -> <a href="Nethttpd_types.extended_environment.html">extended_environment</a> -> </code><code class="type"><a href="Nethttpd_types.extended_environment.html">extended_environment</a></code></pre><div class="info">
 
251
<pre><span name="TYPEredirected_environment"><span class="keyword">class</span> <a href="Nethttpd_types.redirected_environment-c.html">redirected_environment</a></span> : <code class="type">?in_header:<a href="Nethttp.http_header-c.html">Nethttp.http_header</a> -> ?properties:(string * string) list -> ?in_channel:<a href="Netchannels.in_obj_channel-c.html">Netchannels.in_obj_channel</a> -> <a href="Nethttpd_types.extended_environment-c.html">extended_environment</a> -> </code><code class="type"><a href="Nethttpd_types.extended_environment-c.html">extended_environment</a></code></pre><div class="info">
180
252
This class overlays the input-side containers of an existing environment.
181
253
</div>
182
254
<br>
183
 
<a name="2_AuxiliaryFunctionsforEnvironments"></a>
184
 
<h2>Auxiliary Functions for Environments</h2><br>
185
 
<pre><span class="keyword">val</span> <a name="VALoutput_static_response"></a>output_static_response : <code class="type">#<a href="Nethttpd_types.extended_environment.html">extended_environment</a> -><br>       <a href="Nethttp.html#TYPEhttp_status">Nethttp.http_status</a> -> <a href="Nethttp.http_header.html">Nethttp.http_header</a> option -> string -> unit</code></pre><div class="info">
 
255
<span id="2_AuxiliaryFunctionsforEnvironments"><h2>Auxiliary Functions for Environments</h2></span><br>
 
256
<pre><span id="VALoutput_static_response"><span class="keyword">val</span> output_static_response</span> : <code class="type">#<a href="Nethttpd_types.extended_environment-c.html">extended_environment</a> -><br>       <a href="Nethttp.html#TYPEhttp_status">Nethttp.http_status</a> -> <a href="Nethttp.http_header-c.html">Nethttp.http_header</a> option -> string -> unit</code></pre><div class="info">
186
257
Outputs the string argument as response body, together with the given status and
187
258
 the header (optional). Response header fields are set as follows:<ul>
188
259
<li>The <code class="code">Content-Length</code> is set to the length of the string.</li>
192
263
 If the header is not passed, the header of the environment is taken. If the header
193
264
 argument exists, however, it overrides the header of the environment.<br>
194
265
</div>
195
 
<pre><span class="keyword">val</span> <a name="VALoutput_file_response"></a>output_file_response : <code class="type">#<a href="Nethttpd_types.extended_environment.html">extended_environment</a> -><br>       <a href="Nethttp.html#TYPEhttp_status">Nethttp.http_status</a> -><br>       <a href="Nethttp.http_header.html">Nethttp.http_header</a> option -> string -> int64 -> int64 -> unit</code></pre><div class="info">
 
266
<pre><span id="VALoutput_file_response"><span class="keyword">val</span> output_file_response</span> : <code class="type">#<a href="Nethttpd_types.extended_environment-c.html">extended_environment</a> -><br>       <a href="Nethttp.html#TYPEhttp_status">Nethttp.http_status</a> -><br>       <a href="Nethttp.http_header-c.html">Nethttp.http_header</a> option -> string -> int64 -> int64 -> unit</code></pre><div class="info">
196
267
Outputs the contents of a file as response body, together with the given status and
197
268
 the header (optional). The string is the file name. The first int64 number is
198
269
 the position in the file where to start, and the second number is the length
211
282
 
212
283
 The function raises <code class="code">Sys_error</code> when the file cannot be read.<br>
213
284
</div>
214
 
<pre><span class="keyword">class type</span> <a name="TYPEmin_config"></a><a href="Nethttpd_types.min_config.html">min_config</a> = <code class="code">object</code> <a href="Nethttpd_types.min_config.html">..</a> <code class="code">end</code></pre><div class="info">
 
285
<br>
 
286
<span id="1_Generatingerrorresponseslogging"><h1>Generating error responses, logging</h1></span><br>
 
287
<pre><span id="TYPErequest_info"><span class="keyword">class type</span> <a href="Nethttpd_types.request_info-c.html">request_info</a></span> = <code class="code">object</code> <a href="Nethttpd_types.request_info-c.html">..</a> <code class="code">end</code></pre><pre><span id="TYPEfull_info"><span class="keyword">class type</span> <a href="Nethttpd_types.full_info-c.html">full_info</a></span> = <code class="code">object</code> <a href="Nethttpd_types.full_info-c.html">..</a> <code class="code">end</code></pre><pre><span name="TYPEcreate_full_info"><span class="keyword">class</span> <a href="Nethttpd_types.create_full_info-c.html">create_full_info</a></span> : <code class="type">response_status_code:int -> request_body_rejected:bool -> output_header:<a href="Nethttp.http_header-c.html">Nethttp.http_header</a> -> output_body_size:int64 -> <a href="Nethttpd_types.request_info-c.html">request_info</a> -> </code><code class="type"><a href="Nethttpd_types.full_info-c.html">full_info</a></code></pre><div class="info">
 
288
Creates a <code class="code">full_info</code> object by adding to a <code class="code">request_info</code> object
 
289
</div>
 
290
<pre><span id="TYPEerror_response_params"><span class="keyword">class type</span> <a href="Nethttpd_types.error_response_params-c.html">error_response_params</a></span> = <code class="code">object</code> <a href="Nethttpd_types.error_response_params-c.html">..</a> <code class="code">end</code></pre><pre><span id="TYPEmin_config"><span class="keyword">class type</span> <a href="Nethttpd_types.min_config-c.html">min_config</a></span> = <code class="code">object</code> <a href="Nethttpd_types.min_config-c.html">..</a> <code class="code">end</code></pre><div class="info">
215
291
Minimal configuration needed for <code class="code">output_std_response</code>
216
292
</div>
217
 
<pre><span class="keyword">val</span> <a name="VALoutput_std_response"></a>output_std_response : <code class="type">#<a href="Nethttpd_types.min_config.html">min_config</a> -><br>       #<a href="Nethttpd_types.extended_environment.html">extended_environment</a> -><br>       <a href="Nethttp.html#TYPEhttp_status">Nethttp.http_status</a> -> <a href="Nethttp.http_header.html">Nethttp.http_header</a> option -> string option -> unit</code></pre><div class="info">
 
293
<pre><span id="VALoutput_std_response"><span class="keyword">val</span> output_std_response</span> : <code class="type">#<a href="Nethttpd_types.min_config-c.html">min_config</a> -><br>       #<a href="Nethttpd_types.extended_environment-c.html">extended_environment</a> -><br>       <a href="Nethttp.html#TYPEhttp_status">Nethttp.http_status</a> -> <a href="Nethttp.http_header-c.html">Nethttp.http_header</a> option -> string option -> unit</code></pre><div class="info">
218
294
Outputs a "standard response" for the <code class="code">http_status</code>. The string argument
219
295
 is an optional entry into the error log.
220
296
<p>
223
299
 exists, this header is taken. The header of the environment is never taken.<br>
224
300
</div>
225
301
<br>
226
 
<a name="service"></a>
227
 
<h1>Service Providers</h1>
 
302
<span id="service"><h1>Service Providers</h1></span>
228
303
<p>
229
304
 
230
305
 Service providers are defined using the three class types:<ul>
262
337
   when the file already exists)</li>
263
338
</ul>
264
339
<br>
265
 
<pre><span class="keyword">exception</span> <a name="EXCEPTIONRedirect_request"></a>Redirect_request <span class="keyword">of</span> <code class="type">string * <a href="Nethttp.http_header.html">Nethttp.http_header</a></code></pre>
 
340
<pre><span id="EXCEPTIONRedirect_request"><span class="keyword">exception</span> Redirect_request</span> <span class="keyword">of</span> <code class="type">string * <a href="Nethttp.http_header-c.html">Nethttp.http_header</a></code></pre>
266
341
<div class="info">
267
342
The "early" redirect is only allowed in stage 1 of HTTP processing.
268
343
 The string argument is the new URI path of the request. The header can also
269
344
 be exchanged except the fields that are needed to decode the request
270
345
 body. It is not possible to change the method.<br>
271
346
</div>
272
 
<pre><span class="keyword">exception</span> <a name="EXCEPTIONRedirect_response"></a>Redirect_response <span class="keyword">of</span> <code class="type">string * <a href="Nethttp.http_header.html">Nethttp.http_header</a></code></pre>
 
347
<pre><span id="EXCEPTIONRedirect_response"><span class="keyword">exception</span> Redirect_response</span> <span class="keyword">of</span> <code class="type">string * <a href="Nethttp.http_header-c.html">Nethttp.http_header</a></code></pre>
273
348
<div class="info">
274
349
The "late" redirect is only allowed in stage 3 of HTTP processing.
275
350
 The string argument is the new URI path of the request.  The header can also
276
351
 be exchanged except the fields that are needed to decode the request
277
352
 body. <b>The method is always changed to <code class="code">GET</code>.</b><br>
278
353
</div>
279
 
<pre><span class="keyword">class type</span> <a name="TYPEhttp_service_generator"></a><a href="Nethttpd_types.http_service_generator.html">http_service_generator</a> = <code class="code">object</code> <a href="Nethttpd_types.http_service_generator.html">..</a> <code class="code">end</code></pre><pre><span class="keyword">class type</span> <a name="TYPEhttp_service_receiver"></a><a href="Nethttpd_types.http_service_receiver.html">http_service_receiver</a> = <code class="code">object</code> <a href="Nethttpd_types.http_service_receiver.html">..</a> <code class="code">end</code></pre><pre><span class="keyword">type</span> <a name="TYPEhttp_service_reaction"></a><code class="type"></code>http_service_reaction = <code class="type">[ `Accept_body of <a href="Nethttpd_types.http_service_receiver.html">http_service_receiver</a><br>       | `File of<br>           <a href="Nethttp.html#TYPEhttp_status">Nethttp.http_status</a> * <a href="Nethttp.http_header.html">Nethttp.http_header</a> option * string * int64 * int64<br>       | `Reject_body of <a href="Nethttpd_types.http_service_generator.html">http_service_generator</a><br>       | `Static of <a href="Nethttp.html#TYPEhttp_status">Nethttp.http_status</a> * <a href="Nethttp.http_header.html">Nethttp.http_header</a> option * string<br>       | `Std_response of<br>           <a href="Nethttp.html#TYPEhttp_status">Nethttp.http_status</a> * <a href="Nethttp.http_header.html">Nethttp.http_header</a> option * string option ]</code> </pre>
 
354
<pre><span id="TYPEhttp_service_generator"><span class="keyword">class type</span> <a href="Nethttpd_types.http_service_generator-c.html">http_service_generator</a></span> = <code class="code">object</code> <a href="Nethttpd_types.http_service_generator-c.html">..</a> <code class="code">end</code></pre><pre><span id="TYPEhttp_service_receiver"><span class="keyword">class type</span> <a href="Nethttpd_types.http_service_receiver-c.html">http_service_receiver</a></span> = <code class="code">object</code> <a href="Nethttpd_types.http_service_receiver-c.html">..</a> <code class="code">end</code></pre><pre><span id="TYPEhttp_service_reaction"><span class="keyword">type</span> <code class="type"></code>http_service_reaction</span> = <code class="type">[ `Accept_body of <a href="Nethttpd_types.http_service_receiver-c.html">http_service_receiver</a><br>       | `File of<br>           <a href="Nethttp.html#TYPEhttp_status">Nethttp.http_status</a> * <a href="Nethttp.http_header-c.html">Nethttp.http_header</a> option * string * int64 * int64<br>       | `Reject_body of <a href="Nethttpd_types.http_service_generator-c.html">http_service_generator</a><br>       | `Static of <a href="Nethttp.html#TYPEhttp_status">Nethttp.http_status</a> * <a href="Nethttp.http_header-c.html">Nethttp.http_header</a> option * string<br>       | `Std_response of<br>           <a href="Nethttp.html#TYPEhttp_status">Nethttp.http_status</a> * <a href="Nethttp.http_header-c.html">Nethttp.http_header</a> option * string option ]</code> </pre>
280
355
<div class="info">
281
356
Indicates the immediate reaction upon an arriving HTTP header:<ul>
282
357
<li><code class="code">`Accept_body</code> is the regular way of processing requests. If necessary,
302
377
<br>
303
378
</div>
304
379
 
305
 
<pre><span class="keyword">class type</span> <a name="TYPEhttp_service"></a><code class="type">['a]</code> <a href="Nethttpd_types.http_service.html">http_service</a> = <code class="code">object</code> <a href="Nethttpd_types.http_service.html">..</a> <code class="code">end</code></pre><br>
306
 
<a name="helpers"></a>
307
 
<h1>Helpers</h1><br>
308
 
<pre><span class="keyword">val</span> <a name="VALupdate_alist"></a>update_alist : <code class="type">('a * 'b) list -> ('a * 'b) list -> ('a * 'b) list</code></pre><div class="info">
 
380
<pre><span id="TYPEhttp_service"><span class="keyword">class type</span> <code class="type">['a]</code> <a href="Nethttpd_types.http_service-c.html">http_service</a></span> = <code class="code">object</code> <a href="Nethttpd_types.http_service-c.html">..</a> <code class="code">end</code></pre><br>
 
381
<span id="helpers"><h1>Helpers</h1></span><br>
 
382
<pre><span id="VALupdate_alist"><span class="keyword">val</span> update_alist</span> : <code class="type">('a * 'b) list -> ('a * 'b) list -> ('a * 'b) list</code></pre><div class="info">
309
383
<code class="code">update_alist updl l</code>: Returns the alist with all elements of <code class="code">updl</code>
310
384
 and all elements of <code class="code">l</code> that are not member of <code class="code">updl</code>.<br>
311
385
</div>