Skip to content
it4e edited this page Apr 17, 2016 · 1 revision

Name

<chl/chl.h>

chl_post, CHL POST

Declaration

char * chl_post(char * name);

Description

The chl_post function is used to fetch the value of the POST method variable [name].

Arguments

  • name: the name of the POST variable

Return value

On success: POST variable value, 0 if POST variable is not defined.


Examples

Call CHL controller file 'index.chl' with POST parameters (name=Olof, id=10)

POST index.chl HTTP/1.1

name=Olof&id=10

main.c

#include <chl/chl.h>
#include <stdio.h>

int main() {
    chl_set_default_headers();
    chl_print_headers();

    printf("%s has id %s.", chl_post("name"), chl_post("id"));
}

Output: Olof has id 10.

As CHL is open-source, people are able to contribute with their own APIs, plugins and code which means that CHL is constantly upgraded and provided with new features. Do you have an idea for a new CHL feature and want to contribute?

See contribute.

Setup. API. Tutorial. Examples. FastCGI.

Clone this wiki locally