This method retrieves the specified item from a Request object dictionary.

HRESULT get_Item(


//VARIANT that contains the name of the item in the collection

VARIANT * pVariantReturn

//pointer to a VARIANT that receives the item value



If Var is passed as an optional parameter (V_VT(&Var) == VT_ERROR and V_ERROR(&Var) is DISP_E_PARAMNOTFOUND), then the type of value returned depends on the objects's implementation of the IRequestDictionary interface:

For Request.QueryString, *pVariantReturn contains the unparsed query string data.

For Request.Form, *pVariantReturn contains the unparsed form data.

For Request.Cookies, *pVariantReturn contains a URL-encoded list of the cookies.

For Request.ClientCertificate, *pVariantReturn contains a URL-encoded list of the items in the certificate.

Request.ServerVariables and Response.Cookies do not accept an optional VARIANT parameter, and will raise an OLE Automation exception if Var is DISP_E_PARAMNOTFOUND.

If Var is not an optional parameter then it must be a VT_BSTR or a VT_DISPATCH pointer with a default value that can be converted to a BSTR. In this case, the BSTR value of Var is looked up in the appropriate dictionary, and the value of Var is returned. If Var is not in the dictionary, then a VARIANT equal to VT_EMPTY is returned if the IRequestDictionary is covering one of the Request object's collections. If the IRequestDictionary pointer is the Response.Cookies collection, a new cookie with the name of Var is created, and that cookie is returned. If Var is not a BSTR (and not DISP_E_PARAMNOTFOUND), then the get_Item method will raise an OLE Automation exception.

© Microsoft Corporation. All rights reserved.