Try OpenEdge Now
skip to main content
Developing WebSpeed Applications
SpeedScript : WebSpeed API functions : Passing information between Web requests : URL query strings
 
URL query strings
URL query strings are used to pass a wide range of information. WebSpeed provides several API functions to facilitate the building and reading of URLs, listed in the following table. (The definitions for these functions reside in install-path/src/web/method/cgiutils.i.)
Table 5. URL API functions
Function
Return type
Description
url-decode
CHARACTER
Decodes a URL form input from either CGI POST and GET request methods or encoded Cookie values, and returns the decoded string.
url-encode
CHARACTER
Encodes unsafe characters in a URL (per RFC 1738 section 2.2) plus ASCII values between 0 and 31 and between 127 and 255. Options modify the encode to handle URL query strings, persistent cookies, or a specified string of characters. Returns the encoded string.
url-field-list
CHARACTER
Encodes a list of name/value pairs from a list of names whose values are retrievable from the current request by the get-value API function. Parameters include the name list and delimiter. Returns the encoded list of name/value pairs.
url-field
CHARACTER
Encodes name/value pairs for use as an argument field to a URL. Parameters include the name, value, and delimiter for the pair. Returns the encoded name/value pair.
url-format
CHARACTER
Formats a URL from a base URL, name list, and delimiter. (The name list is encoded using url-field-list.) Returns encoded URL.
For most applications, the url-format function is the main API function to construct URLs. This function calls all the others in the table. To construct URL query strings, you also must call the set-user-field function to assemble the name/value pairs for output with the query string.
For reading URL query strings, the easiest and most common function to use is get-value, which searches several sources for the value associated with a name. For more information, see General information exchange.
URL query strings are limited in terms of the amount of information per URL. For larger lists of data that might accumulate in applications such as Internet shopping carts, you might choose to use hidden form fields.