CHttpServer::DeleteClientHeader Method  
 
BOOL DeleteClientHeader(
  UINT nClientId,  
  UINT nHeaderType,  
  LPCTSTR lpszHeaderName  
);

Delete a request or response header for the specified client session.

Parameters

nClientId
An unsigned integer which uniquely identifies the client session.
nHeaderType
Specifies the type of header to delete. It may be one of the following values:
Value Description
HTTP_HEADERS_REQUEST Delete a request header that was provided by the client. Request header values provide additional information to the server about the type of request being made.
HTTP_HEADERS_RESPONSE Delete a response header that was created by the server. Response header values provide additional information to the client about the type of information that is being returned by the server.
lpszHeaderName
A null-terminated string that specifies the name of the header that should be deleted. Header names are not case-sensitive and should not include the colon which acts as a delimiter that separates the header name from its value. This parameter cannot be a NULL pointer or an empty string.

Return Value

If the method succeeds, the return value is non-zero. If the client ID does not specify a valid client session, the method will return zero. If the method fails, the GetLastError method will return more information about the last error that has occurred.

Remarks

The DeleteClientHeader method will delete a request or response header for the specified client session. There are a number of required response headers that are always sent to a client and deleting the header using this method will cause the server to automatically generate a new default header value. You should not delete response header values unless you are certain of the impact that it would have on the normal operation of the client.

It is not necessary for you to delete a header value to change the value of an existing header. The SetClientHeader method will replace an existing header value with a new value, or create a new header if the header name does not already exist.

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: cshtsv12.lib
Unicode: Implemented as Unicode and ANSI versions

See Also