Request Parameters
For each new request of the server, Yuma populates four
dictionaries with valuable information that you will often need to service the request.
GET ParametersEvery standard link in a web page generates a GET request of the web server. The portion of a url that follows a "?" (question mark) is called the query string. The query string is divided into key-value pairs, separated by an & (ampersand), with an "=" (equal sign) between each name and value. Yuma populates a
GetParams dictionary with all of the name-value pairs that are received in the query string portion of a url. HTML form fields that are submitted using an HTML form with a method of "GET" are also loaded into the GetParams
dictionary.
HTML Form GET Example<form method="get" target="./">
<input name="myField" type="text" value="userValue" />
</form>
URL Query String Examplehttp://www.example.com?myField=userValuePOST ParametersPOST requests are sent to a server via an HTML form. The field data in the HTML form is packaged by your browser and sent to the server behind the scenes. Unlike a GET request that includes all query string (field) data in the URL which is visible in the browser address bar, all POST data is invisible to site visitor. Yuma populates a
PostParams dictionary with all of the name-value pairs that are received in the fields of a form post.
HTML Form POST Example<form method="post" target="./">
<input name="myField" type="text" value="userValue" />
</form>
CookiesYuma populates a
Cookies dictionary with any cookies (i.e. named chunks of data stored on the client machine) that were sent by the browser with the request. Each key is a cookie name, with the value being the corresponding cookie value. (See
Session.SetCookie for information on setting cookies.)
Request ParametersYuma populates a
RequestParams dictionary as a convenience which includes all of the name-value pairs from GetParams, PostParams, and Cookies.
Server ParametersInformation about the server, requesting agent/browser, and operating environment of the server is loaded into the
ServerParams dictionary. The values in ServerParams may vary slightly from server to server when running under the Yuma Enterprise Server because it is the responsibility of the web server to pass the name-value pairs to Yuma. You can expect to receive the following list of parameters for a typical request:
| Parameter | Example
|
| SCRIPT_URL | /docwiki/
|
| SCRIPT_URI | http://www.yumadev.com/docwiki/
|
| YUMA_DIRECTORY_INDEX | index.yuma,index.html,index.htm (note you must enable mod_env in Apache to configure these values. Then use SetEnv and PassEnv to send them from Apache to Yuma.)
|
| HTTP_USER_AGENT | Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1
|
| HTTP_CACHE_CONTROL | max-age=0
|
| HTTP_REFERER | http://www.yumadev.com/docwiki/Dictionary
|
| HTTP_ACCEPT | text/xml,application/xml,application/xhtml+xml,text/html;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5
|
| HTTP_ACCEPT_LANGUAGE | en-us
|
| HTTP_ACCEPT_ENCODING | gzip, deflate
|
| HTTP_COOKIE | YumaDocWiki=1234567890ABCDEF
|
| HTTP_CONNECTION | keep-alive
|
| HTTP_HOST | www.yumadev.com
|
| PATH | /usr/bin:/bin:/usr/sbin:/sbin
|
| SERVER_SIGNATURE |
|
| SERVER_SOFTWARE | Apache/2.2.8 (Unix) mod_ssl/2.2.8 OpenSSL/0.9.7l DAV/2 mod_fastcgi/2.4.2
|
| SERVER_NAME | www.yumadev.com
|
| SERVER_ADDR | 127.0.0.1
|
| SERVER_PORT | 80
|
| REMOTE_ADDR | 127.0.0.1
|
| DOCUMENT_ROOT | /path/to/site/root
|
| SERVER_ADMIN | you@example.com
|
| SCRIPT_FILENAME | /path/to/site/root/yumaserver
|
| REMOTE_PORT | 53279
|
| GATEWAY_INTERFACE | CGI/1.1
|
| SERVER_PROTOCOL | HTTP/1.1
|
| REQUEST_METHOD | GET
|
| QUERY_STRING |
|
| REQUEST_URI | /docwiki/
|
| SCRIPT_NAME |
|
| PATH_INFO | /docwiki/
|
| PATH_TRANSLATED | /path/to/site/root/yumaserver/docwiki/
|
You will use the HTTP_USER_AGENT value in ServerParams to take browser-specific actions when preparing a response if necessary.