CHttpClient::GetNextHeader Method  
 
BOOL GetNextHeader(
  LPTSTR lpszHeader,  
  LPINT lpcchHeader,  
  LPTSTR lpszValue,  
  LPINT lpcchValue  
);
BOOL GetNextHeader(
  CString& strHeader,  
  CString& strValue  
);

The GetNextHeader method returns the name and value of the next response header.

Parameters

lpszHeader
A pointer to a string buffer that will contain the name of the header field when the method returns.
lpcchHeader
A pointer to an integer which specifies the maximum number of characters which may be copied into the buffer, including the terminating null character. When the method returns, this value is updated to specify the actual length of the header name string.
lpszValue
A pointer to a string buffer that will contain the name of the header value when the method returns.
lpcchValue
A pointer to an integer which specifies the maximum number of characters which may be copied into the buffer, including the terminating null character. When the method returns, this value is updated to specify the actual length of the header value string.

Return Value

If the method succeeds, the return value is non-zero. If the header field does not exist or the client handle is invalid, the method returns a value of zero. To get extended error information, call GetLastError.

Remarks

Use this method iteratively after GetFirstHeader to enumerate all request or response headers.

Unlike the GetHeader method, which returns a single header name and value, the GetFirstHeader and GetNextHeader methods will return multiple headers that have the same common name.

Requirements

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

See Also

GetHeader, GetFirstHeader, SetHeader