Module Netcgi_types

module Netcgi_types: sig .. end
Basic types for CGI and related protocols

exception Resources_exceeded
Raised when the CGI input is longer than the configured maximum
class type simple_message = Netmime.mime_body
A simple_message stores the value of the CGI argument as an unstructured string value.
type store = [ `File of string | `Memory ] 
Determines where the data of the CGI argument are actually stored.
type representation = [ `MIME of Netmime.mime_message | `Simple of simple_message ] 
Representations of CGI arguments:
class type cgi_argument = object .. end
The interface of CGI argument objects
type cgi_cookie = Nethttp.cookie = {
   cookie_name : string; (*The name of the cookie*)
   cookie_value : string; (*The value of the cookie. There are no restrictions on the value of the cookie*)
   cookie_expires : float option; (*Expiration:
  • None: the cookie expires when the browser session ends.
  • Some t: the cookie expires at the time t (seconds since the epoch)
   cookie_domain : string option; (*Cookies are bound to a certain domain, i.e. the browser sends them only when web pages of the domain are requested:

  • None: the domain is the hostname of the server
  • Some domain: the domain is domain
   cookie_path : string option; (*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.

  • None: the path is script name + path_info
  • Some p: the path is p. With Some "/" you can disable the path restriction completely.
   cookie_secure : bool; (*Cookies are also bound to the type of the web server: false means servers without SSL, true means servers with activated SSL ("https").*)
type status = Nethttp.http_status 
type request_method = [ `DELETE | `GET | `HEAD | `POST | `PUT of cgi_argument ] 
The supported request methods:
type cache_control = [ `Max_age of int | `No_cache | `Unspecified ] 
This is only a small subset of the HTTP 1.1 cache control features, but they are usually sufficient, and they work for HTTP/1.0 as well. The directives mean: Notes:
type query_string_spec = [ `Args of cgi_argument list | `Current | `Initial | `None ] 
Determines how the query part of URLs is generated:

type other_url_spec = [ `Env | `None | `This of string ] 
Determines how an URL part is generated:

class type cgi_activation = object .. end
The common interface of CGI activation objects