Skip to content

Latest commit

 

History

History
47 lines (35 loc) · 3.5 KB

ihttpcontext-getresponseheaderssent-method.md

File metadata and controls

47 lines (35 loc) · 3.5 KB
title description ms.date ms.assetid
IHttpContext::GetResponseHeadersSent Method
Describes the IHttpContext::GetResponseHeadersSent method and details its syntax, parameters, return value, remarks, code example, and requirements.
10/07/2016
06006ede-2e42-a1c4-6627-3336ac22f636

IHttpContext::GetResponseHeadersSent Method

Determines whether the HTTP response headers have been sent to the client.

Syntax

virtual BOOL GetResponseHeadersSent(  
   VOID  
) const = 0;  

Parameters

This method takes no parameters.

Return Value

true if the HTTP response headers have been sent; otherwise, false.

Remarks

The GetResponseHeadersSent method determines whether another module has already sent the HTTP response headers to the client (for example, another HTTP module has called the IHttpResponse::Flush method). The GetResponseHeadersSent method is especially useful when you are creating an HTTP module that writes values to the headers, because it enables you to have deterministic control over the information that your HTTP module outputs to a Web client.

Example

The following code example demonstrates how to use the GetResponseHeadersSent method to create an HTTP module that determines whether the headers have been written to the client. The module indicates the result by returning a message to a Web client.

[!code-cppIHttpContextGetResponseHeadersSent#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 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

IHttpContext Interface
IHttpResponse::Flush Method