CGI Form Submissions
uC-HTTPs supports HTML form submissions through the POST method. The following POST Internet media type are supported:
"application/x-www-form-urlencoded"
is the default format for encoding key-value pairs when a web browser sends a POST request from a web form element."multipart/form-data"
is the format that must be used when uploading large amount of data such as a file on a web server. It must be specified in the form tag as example:<form action="upload.html" ENCTYPE="multipart/form-data" method="post">
When the form is posted, the web server will process the POST action and will invoke the callback with a list of key-value pair transmitted. Assuming the HTML page that look like this:
<html>
<body>
<form action="form_return_page.htm" method="post">
Text Box 1: <input type="text" name="textbox1" /><br>
Text Box 2: <input type="text" name="textbox1" /><br>
<input type="submit" name="submit" value="Submit"></input>
</form>
</body>
</html>
When the client send the request, the web server should call the callback function with the following key pair values items:
Key-Name: "textbox1", Key-Value: "Text Box 1 value"
Key-Name: "textbox2", Key-Value: "Text Box 2 value"
Key-Name: "submit", Key-Value: "Submit"
section 4-12-8 “CGI Post” for further details about the implementation to this hook function.
If the upper application require to a while to complete the processing of CGI post the upper application should implement a task where CGI data can be queued and can be polled to know if the processing is completed.