Skip to content

Latest commit

 

History

History
50 lines (37 loc) · 3.7 KB

File metadata and controls

50 lines (37 loc) · 3.7 KB
title IHttpResponse::SuppressHeaders Method
description Describes the IHttpResponse::SuppressHeaders method and details its syntax, parameters, return value, remarks, code example, and requirements.
ms.date 10/07/2016
ms.assetid 09879c26-c001-5d7e-6c82-e53005d55120

IHttpResponse::SuppressHeaders Method

Suppresses the response status and headers.

Syntax

virtual VOID SuppressHeaders(  
   VOID  
) = 0;  

Parameters

This method takes no parameters.

Return Value

VOID.

Remarks

The SuppressHeaders method enables you to create responses without HTTP headers. Status and headers are still available to your application, but they are not sent to the client.

Note

When HTTP headers are suppressed, a Web client that requires a full HTTP response may appear to be working with an unresponsive server. This unresponsive behavior occurs because the Web client is waiting for the response status and headers before it continues processing the response.

Example

The following code example demonstrates how to use the IHttpResponse::GetHeadersSuppressed method to create an HTTP module that tests whether the headers are currently suppressed. The module then calls the SuppressHeaders method to prevent the default HTTP headers from being sent. Finally, the module uses the IHttpResponse::WriteEntityChunks method to return a raw HTTP response to the client.

[!code-cppIHttpResponseGetHeadersSuppressed#1]

Your module must export the RegisterModule function. You can export this function by creating a module definition (.def) file for your project, or you can compile the module by using the /EXPORT:RegisterModule switch. For more information, see Walkthrough: Creating a Request-Level HTTP Module By Using Native Code.

You can optionally compile the code by using the __stdcall (/Gz) calling convention instead of explicitly declaring the calling convention for each function.

Requirements

Type Description
Client - IIS 7.0 on [!INCLUDEwinvista]
- IIS 7.5 on Windows 7
- IIS 8.0 on Windows 8
- IIS 10.0 on Windows 10
Server - IIS 7.0 on [!INCLUDEwinsrv2008]
- IIS 7.5 on Windows Server 2008 R2
- IIS 8.0 on Windows Server 2012
- IIS 8.5 on Windows Server 2012 R2
- IIS 10.0 on Windows Server 2016
Product - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0
- [!INCLUDEiisexp75], [!INCLUDEiisexp80], [!INCLUDEiisexp100]
Header Httpserv.h

See Also

IHttpResponse Interface
IHttpResponse::GetHeadersSuppressed Method