Allows you to get or set a specified item in an HTTP-request.
returnValue = Inet_QueryParam(Request, ItemName, DefaultValue, NewValue)
The Inet_QueryParam() function has the following parameters:
Parameters | Description |
---|---|
Request | [in/out]HTTP-request |
ItemName | [in] name of an item to look for |
DefaultValue | [in] the value to return if the item name is not found |
NewValue | [in] if assigned, new value for the item |
The value of a specified item. If item is not found the value of the DefaultValue parameter will be returned. If DefaultValue parameter not specified and the item is not found, null ("") is returned.
Assume an OECGI call from the browser as shown below:
http://127.0.0.1/cgi-bin/oecgi.exe/INET_OI_XML_DYN?FILENAME=PRODUCTS&FIELDS=DESCRIPTION,UNIT PRICE
The HTTP request, which passes the FILENAME and the FIELDS, with the parameters separated by an ampersand (&), is:
FILENAME=PRODUCTS&FIELDS=DESCRIPTION,UNIT PRICE
In the Inet_OI_XML_DYN() procedure, a call to Inet_QueryParam() to retrieve the field list, as shown below:
Fields = Inet_QueryParam(Request,'FIELDS')
would return, in the Fields variable, the following:
DESCRIPTION, UNIT PRICE
Assume an OECGI call to Inet_OI_XML_DYN(), with no FIELD parameter passed, as shown below:
http://127.0.0.1/cgi-bin/oecgi.exe/INET_OI_XML_DYN
To return DESCRIPTION as the default, call Inet_QueryParam() as shown below:
Fields = Inet_QueryParam(Request,'FIELDS','DESCRIPTION')
To test, pass the HTTP request as the first parameter. Thus, the code below:
request = 'FILENAME=PRODUCT&FIELDS=DESCRIPTION, UNIT PRICE'
fields = Inet_QueryParam( request, 'FIELDS')
will return:
DESCRIPTION, UNIT PRICE
Set the DOC_ID parameter in request using Inet_QueryParam, then call Inet_Repos to return the HTML contained in the DOC_ID. The DOC_ID needs to be defined as HTML repository item.
doc_id = 'INET_WEB_CUST_ENTRY'
retVal = Inet_QueryParam(request,"DOC_ID","",doc_id)
varhtml = Inet_Repos(request)
return varhtml