Function cgi::handle

source ·
pub fn handle<F>(func: F)where
    F: Fn(Request) -> Response,
Expand description

Call F as a CGI programme.

Parse & extract the CGI environmental variables, and HTTP request body to create Request, and convert your Response into the correct format and print to stdout. If this programme is not called as CGI (e.g. missing required environmental variables), it will panic.