module Netcgi_types:Basic types for CGI and related protocolssig
..end
exception Resources_exceeded
class type simple_message = Netmime.mime_body
simple_message
stores the value of the CGI argument as an
unstructured string value.
typestore =
[ `File of string | `Memory ]
`Memory
: In an O'Caml string`File name
: In the file name
. The file contains the value of
the argument after all transfer-related encodings have been
removed (i.e. URL-encoding, and MIME transfer encodings).typerepresentation =
[ `MIME of Netmime.mime_message | `Simple of simple_message ]
`Simple msg
: The argument is unstructured`MIME msg
: The argument has a MIME header in addition to the valueclass type cgi_argument =object
..end
typecgi_cookie =
Nethttp.cookie
= {
|
cookie_name : |
(* | The name of the cookie | *) |
|
cookie_value : |
(* | The value of the cookie. There are no restrictions on the value of the cookie | *) |
|
cookie_expires : |
(* | Expiration:
| *) |
|
cookie_domain : |
(* | Cookies are bound to a certain domain, i.e. the browser sends
them only when web pages of the domain are requested:
| *) |
|
cookie_path : |
(* | Cookies are also bound to certain path prefixes, i.e. the browser
sends them only when web pages at the path or below are requested.
| *) |
|
cookie_secure : |
(* | Cookies are also bound to the type of the web server:
false means servers without SSL, true means servers with
activated SSL ("https"). | *) |
typestatus =
Nethttp.http_status
typerequest_method =
[ `DELETE | `GET | `HEAD | `POST | `PUT of cgi_argument ]
`GET
: Side effect-free request of a web resource`POST
: Request with side effects`HEAD
: Only the header of the corresponding `GET
are requested`DELETE
: Request to delete the web resource`PUT arg
: Request to upload the web resourcetypecache_control =
[ `Max_age of int | `No_cache | `Unspecified ]
`No_cache
:
Caches are disabled. The following headers are sent:
Cache-control: no-cache
, Pragma: no-cache
, Expires:
(now - 1 second)`Max_age n
:
Caches are allowed to store a copy of the response for n
seconds.
After that, the response must be revalidated.
Cache-control: max-age n
, Cache-control: must-revalidate
,
Expires:
(now + n
seconds)`Unspecified
:
No cache control header is added to the response.Pragma
and Expires
headers are sent, too.
These fields are not interpreted by HTTP/1.1 clients because
Cache-control
has higher precedence.typequery_string_spec =
[ `Args of cgi_argument list | `Current | `Initial | `None ]
`Initial
: The query string is created from the initial
CGI arguments`Current
: The query string is created from the current
CGI arguments`Args l
: The query string is created from the specified argument list`None
: The query string is omittedtypeother_url_spec =
[ `Env | `None | `This of string ]
`Env
: Take the value from the environment`This v
: Use this value v
. It must already be URL-encoded.`None
: Do not include this part into the URLclass type cgi_activation =object
..end