Home |
Function http_find_string_value Function http_add_get_functions Function http_add_post_functions Function http_set_browser_list Function post_function_entry Function http_set_put_function |
Function post_function_entryCallback functions of this type are called by the Web Server when Post commands are received from a Web browser. void post_function_entry(struct io_context * io_context, long len); Parametersio_contextThe I/O context of the current HTTP session. lenNumber of bytes in the post command sent by the browser. Post callbacks can be used to allow the application to process data posted by a browser. When a Web page receives a post of a form such as: <form action="form_demo.fn" method="post"> it will scan all application supplied arrays installed with function http_add_post_functions for a function associated with the name form_demo.fn. Example:static struct post_function_entry my_post_functions[] = { {"form_demo.fn", form_demo }, {"", END_OF_TABLE} }; http_add_post_functions(my_post_functions); If one is found (form_demo() in this case), the function is called. The callback can read the data sent by the browser using xn_line_get, parse the data with http_find_string_value, and send an acknowledgement with xn_line_put. The callback can use io_context->buffer to send data to the browser using xn_line_put. Note that the buffer is no larger than 1514 bytes. Demo program WebServer contains a complete example of Post callbacks. Function http_set_put_function
|