class type cgi_environment =The class type cgi_environment contains the resources by which the CGI activation is connected to the "outer world". In particular, the following applies:object..end
"HTTP_", and neither "CONTENT_LENGTH"
nor "CONTENT_TYPE"."HTTP_" and the variables "CONTENT_LENGTH" and "CONTENT_TYPE".
There is a certain protocol between the environment and the
cgi_activation objects.
cgi_activation object expects that the input state of the
environment is at least `Received_header when it starts to
process the request. This means that it is the task of the
environment to read the request header in.cgi_activation object reads the request body from
input_ch, and modifies the input state as it reads the bodycgi_activation object sets the response header in the
environment, and calls send_output_header when the right
moment for sending the output header is reached. It does not
write the response header to output_ch itself. This is the
sole task of the send_output_header method of the environment.cgi_activation object
writes the response body to output_ch. The output state is
modified by this object.method config : cgi_config
The following properties are standardised by CGI. The methods
return "" or None (in the case of the port number) when
the property is not available.
method cgi_gateway_interface : stringmethod cgi_server_software : stringmethod cgi_server_name : stringmethod cgi_server_protocol : stringmethod cgi_server_port : int optionmethod cgi_request_method : stringmethod cgi_path_info : stringmethod cgi_path_translated : stringmethod cgi_script_name : stringmethod cgi_query_string : stringmethod cgi_remote_host : stringmethod cgi_remote_addr : stringmethod cgi_auth_type : stringmethod cgi_remote_user : stringmethod cgi_remote_ident : string
method cgi_property : ?default:string -> string -> stringNot_found will be raised unless the default argument is
passed. The default argument determines the result of the function in
this case.
The method takes the case-sensitive name and returns the value of the property. Usually, these properties have uppercase names.
For example, cgi_gateway_interface returns the same as
cgi_property ~default:"" "GATEWAY_INTERFACE"
You can normally not access those fields coming from the HTTP
header. Use the method input_header_field instead.
method cgi_properties : (string * string) listmethod cgi_https : boolHTTPS property. It indicates whether
a secure connection is used (SSL/TLS). This method interprets this
property and returns true if the connection is secure.
This method fails if there is a HTTPS property with an unknown value.method cgi_request_uri : stringmethod protocol : protocol
method input_header : Netmime.mime_headermethod input_header_field : ?default:string -> string -> stringNot_found will be raised unless the default argument
is passed. The default argument determines the result of the function in
this case.
If there are several fields with the same name only the first field will be returned.
The anonymous string is the name of the field. The name is case-insensitive,
and it does not matter whether it consists of lowercase or uppercase
letters. If the name is a compound name, the parts are separated by "-",
e.g. "content-length".
method multiple_input_header_field : string -> string listmethod input_header_fields : (string * string) listmethod user_agent : string"User-agent" field of the request headermethod cookies : (string * string) listmethod input_content_length : int"Content-length" request header field, or raises
Not_found if it is not setmethod input_content_type_string : string"Content-type" request header field or "" if it is
not setmethod input_content_type : string * (string * Mimestring.s_param) list"Content-type" request header field, or raises
Not_found if it is not set.
See also Mimestring.scan_mime_type_ep.method input_ch : Netchannels.in_obj_channelmethod input_state : input_statemethod set_input_state : input_state -> unitcgi_activation implementations.method output_header : Netmime.mime_headermethod output_header_field : ?default:string -> string -> stringNot_found will be raised unless the default argument
is passed. The default argument determines the result of the function in
this case.
If there are several fields with the same name only the first field will be returned.
The anonymous string is the name of the field. The name is case-insensitive,
and it does not matter whether it consists of lowercase or uppercase
letters. If the name is a compound name, the parts are separated by "-",
e.g. "content-length".
method multiple_output_header_field : string -> string listmethod output_header_fields : (string * string) listmethod set_output_header_field : string -> string -> unitmethod set_multiple_output_header_field : string -> string list -> unitmethod set_output_header_fields : (string * string) list -> unitmethod set_status : Nethttp.http_status -> unitStatus output header field.method send_output_header : unit -> unit`Start, this method will encode and send
the output header to the output channel, and the state will be
changed to `Sent_header.
The method will fail if the output state is not `Start.
Note that this method is usually only called by the
cgi_activation object.
method output_ch : Netchannels.out_obj_channelmethod output_state : output_statemethod set_output_state : output_state -> unitcgi_activation implementations.method log_error : string -> unit