Plasma GitLab Archive
Projects Blog Knowledge

Class type Netcgi_types.cgi_argument


class type cgi_argument = object .. end
The interface of CGI argument objects

method name : string
The name of the CGI argument
method value : string
The value of the CGI argument, after all transfer encodings have been removed. If the value is stored in a file, the file will be loaded.
method open_value_rd : unit -> Netchannels.in_obj_channel
Opens the contents of the value as an input channel. This works for all kinds of arguments, independent of store and representation.
method ro : bool
Whether this argument is read-only or not
method store : store
Returns where the argument value is stored
method content_type : string
Returns the content type of the header, or "text/plain" when the header is missing. Parameters of the content type have been stripped off (e.g. charset).
method content_type_params : (string * Mimestring.s_param) list
The parameters of the content type of the header, or [] when the header is missing. Below you find access method for frequently used parameters.
method charset : string
The charset parameter of the content type of the header, or "" when there is no such parameter, or no header.
method filename : string option
The filename parameter found in the header of file uploads. When present, Some name is returned, and None otherwise.
method representation : representation
The representation of the CGI argument
method finalize : unit -> unit
Arguments stored in temp files must be deleted when the argument is no longer used. You can call finalize to delete such files. The method does not have any effect when store = `Memory. The method does never raise any exceptions. If the file does no longer exist (e.g. because it is moved away), or if there are any problems deleting the file, the error will be suppressed. The finalize method is not registered in the garbage collector. You can do that, but it is usually better to call this method manually. cgi_activation supports this.
method set_value : string -> unit
If the representation supports mutable values, the value is set to the passed string. The other properties of the argument are not modified.

If the representation does not support this feature, the exception Netmime.Immutable will be raised.

method open_value_wr : unit -> Netchannels.out_obj_channel
Opens the value for writing. The current value is overwritten. If the value is immutable, the exception Netmime.Immutable will be raised.
This web site is published by Informatikbüro Gerd Stolpmann
Powered by Caml