I am implementing the Apache 2.0.x module in C to interact with the existing product that we have. I need to process FORM data, most likely using POST, but I also want to process GET.
Nick Kew Apache modules have a section on processing form data. It provides code examples for POST and GET that return apr_hash_t key + value pairs in the form. parse_form_from_POST combines the bucket brigade and aligns it to a buffer, and parse_form_from_GET can simply refer to the URL. Both procedures rely on the parse_form_from_string procedure to go through each delimited field and retrieve information in a hash table.
This will be fine, but it seems like it should be an easier way to do this than adding a couple of hundred lines of code to my module. Is there an existing module or routine in apache, apr or apr-util for extracting field names and related data from GET or POST FORM into a structure with which C code can more easily be accessed? I cannot find anything suitable, but it seems like a general need for which there must be a solution.
source share