1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<link rel="stylesheet" href="style.css" type="text/css">
5
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
6
<link rel="Start" href="index.html">
7
<link rel="previous" href="Netcgi_env.html">
8
<link rel="next" href="Netcgi.html">
9
<link rel="Up" href="index.html">
10
<link title="Index of types" rel=Appendix href="index_types.html">
11
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
12
<link title="Index of values" rel=Appendix href="index_values.html">
13
<link title="Index of class methods" rel=Appendix href="index_methods.html">
14
<link title="Index of classes" rel=Appendix href="index_classes.html">
15
<link title="Index of class types" rel=Appendix href="index_class_types.html">
16
<link title="Index of modules" rel=Appendix href="index_modules.html">
17
<link title="Netcgi_env" rel="Chapter" href="Netcgi_env.html">
18
<link title="Netcgi_types" rel="Chapter" href="Netcgi_types.html">
19
<link title="Netcgi" rel="Chapter" href="Netcgi.html">
20
<link title="Netcgi_jserv" rel="Chapter" href="Netcgi_jserv.html">
21
<link title="Netcgi_jserv_ajp12" rel="Chapter" href="Netcgi_jserv_ajp12.html">
22
<link title="Netcgi_jserv_app" rel="Chapter" href="Netcgi_jserv_app.html">
23
<link title="Netcgi_fcgi_10" rel="Chapter" href="Netcgi_fcgi_10.html">
24
<link title="Netcgi_fcgi" rel="Chapter" href="Netcgi_fcgi.html">
25
<link title="Netcgi1_compat" rel="Chapter" href="Netcgi1_compat.html"><title>Ocamlnet 2 Reference Manual (netcgi1 add-on) : Netcgi_types</title>
28
<div class="navbar"><a href="Netcgi_env.html">Previous</a>
29
<a href="index.html">Up</a>
30
<a href="Netcgi.html">Next</a>
32
<center><h1>Module <a href="type_Netcgi_types.html">Netcgi_types</a></h1></center>
34
<pre><span class="keyword">module</span> Netcgi_types: <code class="code">sig</code> <a href="Netcgi_types.html">..</a> <code class="code">end</code></pre>Basic types for CGI and related protocols<br>
36
<pre><span class="keyword">exception</span> <a name="EXCEPTIONResources_exceeded"></a>Resources_exceeded</pre>
38
Raised when the CGI input is longer than the configured maximum<br>
40
<pre><span class="keyword">class type</span> <a name="TYPEsimple_message"></a><a href="Netcgi_types.simple_message.html">simple_message</a> = <code class="type">Netmime.mime_body</code></pre><div class="info">
41
A <code class="code">simple_message</code> stores the value of the CGI argument as an
42
unstructured string value.
44
<pre><span class="keyword">type</span> <a name="TYPEstore"></a><code class="type"></code>store = <code class="type">[ `File of string | `Memory ]</code> </pre>
46
Determines where the data of the CGI argument are actually stored.<ul>
47
<li><code class="code">`Memory</code>: In an O'Caml string</li>
48
<li><code class="code">`File name</code>: In the file <code class="code">name</code>. The file contains the value of
49
the argument after all transfer-related encodings have been
50
removed (i.e. URL-encoding, and MIME transfer encodings).</li>
55
<pre><span class="keyword">type</span> <a name="TYPErepresentation"></a><code class="type"></code>representation = <code class="type">[ `MIME of Netmime.mime_message | `Simple of <a href="Netcgi_types.simple_message.html">simple_message</a> ]</code> </pre>
57
Representations of CGI arguments:<ul>
58
<li><code class="code">`Simple msg</code>: The argument is unstructured</li>
59
<li><code class="code">`MIME msg</code>: The argument has a MIME header in addition to the value</li>
64
<pre><span class="keyword">class type</span> <a name="TYPEcgi_argument"></a><a href="Netcgi_types.cgi_argument.html">cgi_argument</a> = <code class="code">object</code> <a href="Netcgi_types.cgi_argument.html">..</a> <code class="code">end</code></pre><div class="info">
65
The interface of CGI argument objects
67
<pre><span class="keyword">type</span> <a name="TYPEcgi_cookie"></a><code class="type"></code>cgi_cookie = <code class="type">Nethttp.cookie</code> = {</pre><table class="typetable">
69
<td align="left" valign="top" >
70
<code> </code></td>
71
<td align="left" valign="top" >
72
<code>cookie_name : <code class="type">string</code>;</code></td>
73
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The name of the cookie</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
76
<td align="left" valign="top" >
77
<code> </code></td>
78
<td align="left" valign="top" >
79
<code>cookie_value : <code class="type">string</code>;</code></td>
80
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The value of the cookie. There are no restrictions on the
81
value of the cookie</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
84
<td align="left" valign="top" >
85
<code> </code></td>
86
<td align="left" valign="top" >
87
<code>cookie_expires : <code class="type">float option</code>;</code></td>
88
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Expiration:<ul>
89
<li><code class="code">None</code>: the cookie expires when the browser session ends.</li>
90
<li><code class="code">Some t</code>: the cookie expires at the time <code class="code">t</code> (seconds since
93
</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
96
<td align="left" valign="top" >
97
<code> </code></td>
98
<td align="left" valign="top" >
99
<code>cookie_domain : <code class="type">string option</code>;</code></td>
100
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Cookies are bound to a certain domain, i.e. the browser sends
101
them only when web pages of the domain are requested:
104
<li><code class="code">None</code>: the domain is the hostname of the server</li>
105
<li><code class="code">Some domain</code>: the domain is <code class="code">domain</code></li>
107
</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
110
<td align="left" valign="top" >
111
<code> </code></td>
112
<td align="left" valign="top" >
113
<code>cookie_path : <code class="type">string option</code>;</code></td>
114
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Cookies are also bound to certain path prefixes, i.e. the browser
115
sends them only when web pages at the path or below are requested.
118
<li><code class="code">None</code>: the path is script name + path_info</li>
119
<li><code class="code">Some p</code>: the path is <code class="code">p</code>. With <code class="code">Some "/"</code> you can disable the
120
path restriction completely.</li>
122
</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
125
<td align="left" valign="top" >
126
<code> </code></td>
127
<td align="left" valign="top" >
128
<code>cookie_secure : <code class="type">bool</code>;</code></td>
129
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Cookies are also bound to the type of the web server:
130
<code class="code">false</code> means servers without SSL, <code class="code">true</code> means servers with
131
activated SSL ("https").</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
136
<pre><span class="keyword">type</span> <a name="TYPEstatus"></a><code class="type"></code>status = <code class="type">Nethttp.http_status</code> </pre>
138
<pre><span class="keyword">type</span> <a name="TYPErequest_method"></a><code class="type"></code>request_method = <code class="type">[ `DELETE | `GET | `HEAD | `POST | `PUT of <a href="Netcgi_types.cgi_argument.html">cgi_argument</a> ]</code> </pre>
140
The supported request methods:<ul>
141
<li><code class="code">`GET</code>: Side effect-free request of a web resource</li>
142
<li><code class="code">`POST</code>: Request with side effects</li>
143
<li><code class="code">`HEAD</code>: Only the header of the corresponding <code class="code">`GET</code> are requested</li>
144
<li><code class="code">`DELETE</code>: Request to delete the web resource</li>
145
<li><code class="code">`PUT arg</code>: Request to upload the web resource</li>
150
<pre><span class="keyword">type</span> <a name="TYPEcache_control"></a><code class="type"></code>cache_control = <code class="type">[ `Max_age of int | `No_cache | `Unspecified ]</code> </pre>
152
This is only a small subset of the HTTP 1.1 cache control features,
153
but they are usually sufficient, and they work for HTTP/1.0 as well.
154
The directives mean:<ul>
155
<li><code class="code">`No_cache</code>:
156
Caches are disabled. The following headers are sent:
157
<code class="code">Cache-control: no-cache</code>, <code class="code">Pragma: no-cache</code>, <code class="code">Expires:</code> (now - 1 second)</li>
158
<li><code class="code">`Max_age n</code>:
159
Caches are allowed to store a copy of the response for <code class="code">n</code> seconds.
160
After that, the response must be revalidated.
161
<code class="code">Cache-control: max-age n</code>, <code class="code">Cache-control: must-revalidate</code>,
162
<code class="code">Expires:</code> (now + <code class="code">n</code> seconds)</li>
163
<li><code class="code">`Unspecified</code>:
164
No cache control header is added to the response.</li>
168
<li>Cache control directives only apply to GET requests; POST requests
169
are never cached</li>
170
<li>Not only proxies are considered as cache, but also the local disk
171
cache of the browser</li>
172
<li>HTTP/1.0 did not specify cache behaviour as strictly as HTTP/1.1
173
does. Because of this the <code class="code">Pragma</code> and <code class="code">Expires</code> headers are sent, too.
174
These fields are not interpreted by HTTP/1.1 clients because
175
<code class="code">Cache-control</code> has higher precedence.</li>
180
<pre><span class="keyword">type</span> <a name="TYPEquery_string_spec"></a><code class="type"></code>query_string_spec = <code class="type">[ `Args of <a href="Netcgi_types.cgi_argument.html">cgi_argument</a> list | `Current | `Initial | `None ]</code> </pre>
182
Determines how the query part of URLs is generated:
185
<li><code class="code">`Initial</code>: The query string is created from the initial
187
<li><code class="code">`Current</code>: The query string is created from the current
189
<li><code class="code">`Args l</code>: The query string is created from the specified argument list</li>
190
<li><code class="code">`None</code>: The query string is omitted</li>
195
<pre><span class="keyword">type</span> <a name="TYPEother_url_spec"></a><code class="type"></code>other_url_spec = <code class="type">[ `Env | `None | `This of string ]</code> </pre>
197
Determines how an URL part is generated:
200
<li><code class="code">`Env</code>: Take the value from the environment</li>
201
<li><code class="code">`This v</code>: Use this value <code class="code">v</code>. It must already be URL-encoded.</li>
202
<li><code class="code">`None</code>: Do not include this part into the URL</li>
207
<pre><span class="keyword">class type</span> <a name="TYPEcgi_activation"></a><a href="Netcgi_types.cgi_activation.html">cgi_activation</a> = <code class="code">object</code> <a href="Netcgi_types.cgi_activation.html">..</a> <code class="code">end</code></pre><div class="info">
208
The common interface of CGI activation objects
b'\\ No newline at end of file'