1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/docs/parameters.html Sun Apr 10 21:11:25 2005 +0000
1.3 @@ -0,0 +1,65 @@
1.4 +<?xml version="1.0" encoding="iso-8859-1"?>
1.5 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
1.6 + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1.7 +<html xmlns="http://www.w3.org/1999/xhtml">
1.8 +<head>
1.9 + <title>Request Parameters and Uploads</title>
1.10 + <meta name="generator" content="amaya 8.1a, see http://www.w3.org/Amaya/" />
1.11 + <link href="styles.css" rel="stylesheet" type="text/css" />
1.12 +</head>
1.13 +
1.14 +<body>
1.15 +<h1>Request Parameters and Uploads</h1>
1.16 +
1.17 +<p>Even though it is possible to expose different parts of an application
1.18 +using different <a href="paths.html">URLs and paths</a>, this usually is only
1.19 +enough for applications which model some kind of <a
1.20 +href="paths-filesystem.html">filesystem</a> or repository. Applications which
1.21 +involve user input through forms, for example, need to be able to receive
1.22 +such input by other means, and this is where request parameters come in. For
1.23 +example, when a user fills out a form in a Web browser, the following
1.24 +happens:</p>
1.25 +<ol>
1.26 + <li>The browser collects the values in the form fields and puts them in a
1.27 + request as request parameters.</li>
1.28 + <li>The request is sent to the server environment and into the
1.29 + application.</li>
1.30 + <li>The application reads the field values using the WebStack API.</li>
1.31 +</ol>
1.32 +
1.33 +<h2>Parameter Origins</h2>
1.34 +
1.35 +<p>Request parameters can originate from two sources:</p>
1.36 +<ul>
1.37 + <li><a href="parameters-headers.html">Request headers</a> - parameters are
1.38 + found here when they are specified in the URL as a "query string".</li>
1.39 + <li><a href="parameters-body.html">Request bodies</a> - parameters are
1.40 + found here when the POST <a href="methods.html">request method</a> is
1.41 + used.</li>
1.42 +</ul>
1.43 +
1.44 +<div class="WebStack">
1.45 +<h3>WebStack API - Getting All Parameters</h3>
1.46 +
1.47 +<p>If the origin of the different parameters received in a request is not
1.48 +particularly interesting or important, WebStack provides a convenience method
1.49 +in transaction objects to get all known parameters from a request:</p>
1.50 +<dl>
1.51 + <dt><code>get_fields</code></dt>
1.52 + <dd>This method returns a dictionary mapping field names to lists of
1.53 + values for all known parameters. Each value will be a Unicode
1.54 + object.<br />
1.55 + An optional <code>encoding</code> parameter may be used to assist the
1.56 + process of converting parameter values to Unicode objects - see <a
1.57 + href="parameters-body.html">"Request Body Parameters"</a> and <a
1.58 + href="encodings.html">"Character Encodings"</a> for more discussion of
1.59 + this parameter.</dd>
1.60 +</dl>
1.61 +</div>
1.62 +
1.63 +<p>Generally, it is not recommended to just get all parameters since there
1.64 +may be some parameters from the request headers which have the same names as
1.65 +some other parameters from the request body. Consequently, confusion could
1.66 +arise about the significance of various parameter values.</p>
1.67 +</body>
1.68 +</html>