Request Parameters and Uploads

Even though it is possible to expose different parts of an application using different URLs and paths, this usually is only enough for applications which model some kind of filesystem or repository. Applications which involve user input through forms, for example, need to be able to receive such input by other means, and this is where request parameters come in. For example, when a user fills out a form in a Web browser, the following happens:

  1. The browser collects the values in the form fields and puts them in a request as request parameters.
  2. The request is sent to the server environment and into the application.
  3. The application reads the field values using the WebStack API.

Parameter Origins

Request parameters can originate from two sources:

WebStack API - Getting All Parameters

If the origin of the different parameters received in a request is not particularly interesting or important, WebStack provides a convenience method in transaction objects to get all known parameters from a request:

get_fields
This method returns a dictionary mapping field names to lists of values for all known parameters. Each value will be a Unicode object.
An optional encoding parameter may be used to assist the process of converting parameter values to Unicode objects - see "Request Body Parameters" and "Character Encodings" for more discussion of this parameter.

Generally, it is not recommended to just get all parameters since there may be some parameters from the request headers which have the same names as some other parameters from the request body. Consequently, confusion could arise about the significance of various parameter values.