-
Notifications
You must be signed in to change notification settings - Fork 10
chl_post
it4e edited this page Apr 17, 2016
·
1 revision
<chl/chl.h>
chl_post, CHL POST
char * chl_post(char * name);
The chl_post function is used to fetch the value of the POST method variable [name].
- name: the name of the POST variable
On success: POST variable value, 0 if POST variable is not defined.
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.