Request Header Parameters

Header parameters are typically specified in the URL like this:

http://www.boddie.org.uk/application?param1=value1&param2=value2

Following the rules set out in "URLs and Paths", we can say that the "query string" employed is this:

param1=value1&param2=value2

From this string, we may extract the parameters and state that they are the following:

Parameters encoded in this way can be written into hyperlinks and may be used to remember things as users navigate their way around an application. Alternatively, a Web form (in HTML) written to use the GET request method may be used to achieve the same effect:

<form method="get" action="http://www.boddie.org.uk/application">
<input name="param1" type="text" value="value1" />
<input name="param2" type="text" value="value2" />
</form>

WebStack API - Accessing Header Parameters

Transaction objects provide the following methods to access parameters specified in request headers. The terminology used in the API describes such parameters as path fields, since such parameters are often provided by form fields.

get_fields_from_path
This returns the request parameters (fields) from the request headers (as defined in the path or URL). The fields are provided in a dictionary mapping field names to lists of values
An optional encoding parameter may be used to assist the process of converting parameter values to Unicode objects - see below for a discussion of the issues with this parameter.
get_query_string
This returns the query string - ie. the part of the path or URL which contains the parameters. Typically, it is easier to use the above method instead.

There are some limitations with header parameters: