Forms

Forms send their fields to the server using either one of two methods: get or post.

<html><body>
<!-- method can be get or post -->
<form action="" method="get">
<p>Type Field One: <input type="text" name="field_one">
<input type="submit" value="Submit"></p>
</form>
</body></html>

If you call this page and submit a value you will see the field name and field value appended to the URL in the address bar, like:

http://my_server.tld/dir/path/get_post.html?field_one=submitted value

If the method used is post then the fields will be sent in the HTTP message body in instead.

The Publisher will receive those fields the same way for both methods. It is transparent to the script which method was used to submit the fields.

The FieldStorage class from the util module has all that is necessary to handle submitted data from forms. The Publisher creates an instance of the FieldStorage class and stores a reference to it in the form attribute of the Request object.