CHttpClient::DeleteHeaders Method  
 
BOOL DeleteHeaders(
  UINT nHeaderType  
);

Delete all of the response or request headers for the current session.

Parameters

nHeaderType
Specifies the type of header to delete. It may be one of the following values:
Value Description
HTTP_HEADERS_REQUEST Delete all of the request headers that have been set for the next request sent to the server. This will clear all of the header values that were set using the SetRequestHeader method.
HTTP_HEADERS_RESPONSE Delete all of the headers that were set in response to the previous request. A call to the GetResponseHeader method to obtain a specific header value will fail after this method returns.

Return Value

If the method succeeds, the return value is non-zero. If the method fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

The DeleteHeaders method will release the memory allocated for the request or response headers for the current session. This method is typically used to clear all of the current request headers so that the application may create a new set of headers when a persistent connection is being used. The memory allocated for the request and response headers is normally released when the session handle is closed by calling the Disconnect method.

Whenever a request for a resource is sent to the server, the response headers from the previous request are automatically cleared. It is not necessary for an application to call the DeleteHeaders method to delete the response headers prior to each request.

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

See Also