Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

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"

Each key pair value are stored internally to a list, when all key value pairs have been received the list is posted to the upper application using a callback function called 'GGI post' function. Since all connections are processing within only 1 task it is very important that all hook functions are non-blocking and can be executed quickly. See section 4-12-8 “CGI Post” on page 67 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.

  • No labels