CHttpClient::ClearHeaders Method  
 
VOID ClearHeaders();

The ClearHeaders method resets the the current request and response headers to their default values.

Parameters

None.

Return Value

None.

Remarks

The ClearHeaders method removes all custom header values for the current client session and clears the response headers for the previous request. This method is useful when using persistent connections and you want to ensure that any custom header values from the previous request will not be included with subsequent requests made during the same session. Because this method clears all of the request headers for the client session, this means it will also remove any cookies which have been set using the SetCookie method.

This method will clear any authentication credentials or tokens specified for the current client session. If the next request you make requires authentication, you must provide those credentials again using the Authenticate or SetBearerToken method.

It is not necessary to use this method if the HTTP_OPTION_KEEPALIVE option was not specified when the connection was established. The headers for the previous request are automatically cleared when a new connection is established.

Requirements

Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools11.h
Import Library: cshtpv11.lib

See Also

Authenticate, Connect, GetCookie, GetHeader, SetBearerToken, SetCookie, SetHeader