Skip to main content
ATL Server Library Reference 
CHttpRequest::GetServerVariable 

Call this method to get the value of a server variable from the HTTP request.


BOOL GetServerVariable(
   LPCSTR szVariable,
   CStringA& str 
) const throw( );

Parameters

szVariable

The name of the server variable.

str

A reference to a CString that will receive the string on successful return of this method.

Returns TRUE on success, FALSE on failure. Call GetLastError to get extended error information.

This method is equivalent to calling IHttpServerContext::GetServerVariable on the server context associated with this request.