module Netcgi:Classical CGI implementationsig
..end
For in introduction, see the guide "Introduction into OcamlNet".
For in introduction, see the guide "Introduction into OcamlNet".
class simple_argument :?ro:bool -> string -> string ->
Netcgi_types.cgi_argument
new simple_argument name value
: Creates an unstructured CGI
argument called name
with contents value
.
class mime_argument :?work_around_backslash_bug:bool -> string -> Netmime.mime_message ->
Netcgi_types.cgi_argument
new mime_argument name msg
: Creates a MIME-structured CGI
argument called name
with contents msg
.
typeargument_processing =
[ `Automatic | `File | `Memory ]
`Memory
: Keep the value of the argument in memory`File
: Store the value of the argument in an external file`Automatic
: If the argument is structured and carries a file name,
the value will be stored in a file; otherwise it is loaded into
memory. (Note: The meaning of `Automatic
changed in OcamlNet 0.92.)typeoperating_type =
[ `Direct of string
| `Transactional of
Netcgi_env.cgi_config ->
Netchannels.out_obj_channel -> Netchannels.trans_out_obj_channel ]
`Direct sep
: Data written to the output channel of the activation
object is not collected in a transaction buffer, but directly sent to
the browser (the normal I/O buffering is still active, however,
so call flush
to ensure data are really sent). The method
commit_work
of the output channel is the same as flush
. The method
rollback_work
causes that
the string sep
is sent, meant as a separator between the already
generated output, and the now following error message.`Transactional f
: A transactional channel tc
is created from the
real output channel ch
by calling f cfg ch
(here, cfg
is
the CGI configuration). The channel tc
is propagated as the
output channel of the activation object. This means that the
methods commit_work
and rollback_work
are implemented by
tc
, and the intended behaviour is that data is buffered in a
special transaction buffer until commit_work
is called.
This invocation forces the buffered data to be sent to the
browser. If, however, rollback_work
is called, the buffer is
cleared.`Transactional
:`Transactional(fun cfg ch -> new Netchannels.buffered_output_channel ch)
:
The transaction buffer is implemented in memory`Transactional(fun cfg ch -> new Netchannels.tempfile_output_channel ch)
:
The transaction buffer is implemented as an external fileclass std_activation :?env:Netcgi_env.cgi_environment -> ?processing:string -> Netmime.mime_header -> argument_processing -> ?operating_type:operating_type -> unit ->
Netcgi_types.cgi_activation
val buffered_transactional_optype : operating_type
operating_type
using a Buffer.t
to store
the not yet completed transaction.val tempfile_transactional_optype : operating_type
operating_type
using a temporary file to store
the not yet completed transactionclass custom_activation :?env:Netcgi_env.cgi_environment -> ?args:Netcgi_types.cgi_argument list -> ?meth:Netcgi_types.request_method -> ?operating_type:operating_type -> unit ->
Netcgi_types.cgi_activation