<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <link rel="stylesheet" href="style.css" type="text/css"> <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type"> <link rel="Start" href="index.html"> <link rel="previous" href="Netcgi.mime_argument.html"> <link rel="next" href="Netcgi.custom_activation.html"> <link rel="Up" href="Netcgi.html"> <link title="Index of types" rel=Appendix href="index_types.html"> <link title="Index of exceptions" rel=Appendix href="index_exceptions.html"> <link title="Index of values" rel=Appendix href="index_values.html"> <link title="Index of class methods" rel=Appendix href="index_methods.html"> <link title="Index of classes" rel=Appendix href="index_classes.html"> <link title="Index of class types" rel=Appendix href="index_class_types.html"> <link title="Index of modules" rel=Appendix href="index_modules.html"> <link title="Netcgi_env" rel="Chapter" href="Netcgi_env.html"> <link title="Netcgi_types" rel="Chapter" href="Netcgi_types.html"> <link title="Netcgi" rel="Chapter" href="Netcgi.html"> <link title="Netcgi_jserv" rel="Chapter" href="Netcgi_jserv.html"> <link title="Netcgi_jserv_ajp12" rel="Chapter" href="Netcgi_jserv_ajp12.html"> <link title="Netcgi_jserv_app" rel="Chapter" href="Netcgi_jserv_app.html"> <link title="Netcgi_fcgi_10" rel="Chapter" href="Netcgi_fcgi_10.html"> <link title="Netcgi_fcgi" rel="Chapter" href="Netcgi_fcgi.html"> <link title="Netcgi1_compat" rel="Chapter" href="Netcgi1_compat.html"><title>Ocamlnet 2 Reference Manual (netcgi1 add-on) : Netcgi.std_activation</title> </head> <body> <div class="navbar"><a href="Netcgi.mime_argument.html">Previous</a> <a href="Netcgi.html">Up</a> <a href="Netcgi.custom_activation.html">Next</a> </div> <center><h1>Class <a href="type_Netcgi.std_activation.html">Netcgi.std_activation</a></h1></center> <br> <pre><span class="keyword">class</span> <a name="TYPEstd_activation"></a>std_activation : <code class="type">?env:<a href="Netcgi_env.cgi_environment.html">Netcgi_env.cgi_environment</a> -> ?processing:string -> Netmime.mime_header -> <a href="Netcgi.html#TYPEargument_processing">argument_processing</a> -> ?operating_type:<a href="Netcgi.html#TYPEoperating_type">operating_type</a> -> unit -> </code><code class="type"><a href="Netcgi_types.cgi_activation.html">Netcgi_types.cgi_activation</a></code></pre>This class is an implementation of classical CGI. When the object is created, the CGI arguments are read from the input channel, and it is arranged that the generated page is printed to the output channel. If <code class="code">env</code> is not explicitly passed, the <code class="code">stdin</code> descriptor is used as input, and the <code class="code">stdout</code> descriptor is used as output channel (conforming to the CGI standard); depending on the process environment variables, either the real CGI connector is activated, or the class falls back to a test mode where the user can interactively test the CGI application. <p> By passing <code class="code">env</code>, the class can be configured differently, using other channels for I/O, or other sources for the CGI environment variables. <p> The argument <code class="code">processing</code> determines how the CGI argument objects are created (and where). The default is <code class="code">fun _ _ -> `Memory</code>. <p> The argument <code class="code">operating_type</code> determines whether an additional transaction buffer is created. By default, no such buffer is created (<code class="code">`Direct ""</code>). <p> Example: <pre><code class="code"> let cgi = new std_activation() in let foo_arg = cgi # argument_value "foo" in cgi # set_header ~content_type:"text/plain"(); cgi # output # output_string ("foo = " ^ foo_arg); cgi # commit_work(); (* implies "flush" *) </code></pre> <p> By default, the class only processes POST data encoded as "application/x-www-form-urlencoded" and "multipart/form-data". If the configuration of the environment permits it, data of other types are accepted, too, and one argument "BODY" is created containing the unparsed data.<br> <hr width="100%"> </body></html>