CHttpClient::GetResourceUrl Method  
 
INT GetResourceUrl(
  LPTSTR lpszResource,  
  INT nMaxLength  
);
INT GetResourceUrl(
  CString& strResource  
);

The GetResourceUrl method returns the URL for the current request.

Parameters

lpszResource
A null-terminated string buffer which will contain the URL of the current resource when the method returns. The string will be null terminated and the buffer must be large enough to accommodate the entire URL or the method will fail. This parameter cannot be a NULL pointer. An alternate form of the method accepts a CString variable which will contain the URL.
nMaxLength
The maximum number of characters that may be copied into the string buffer. This value must be greater than zero.

Return Value

If the method succeeds, the return value is the length of the URL. If the method fails, the return value is HTTP_ERROR. To get extended error information, call GetLastError.

Remarks

This method returns the URL for the current request which has been submitted to the server. This can be useful for applications which need to compose a URL for display or logging purposes, combining the connection information and resource path provided to methods such as GetData or PostData.

Requirements

Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools12.h
Import Library: cshtpv12.lib
Unicode: Implemented as Unicode and ANSI versions

See Also