This documentation is archived and is not being maintained.

HttpRequest.SaveAs Method

Saves an HTTP request to disk.

Namespace:  System.Web
Assembly:  System.Web (in System.Web.dll)

public function SaveAs(
	filename : String, 
	includeHeaders : boolean


Type: System.String

The physical drive path.

Type: System.Boolean

A Boolean value specifying whether an HTTP header should be saved to disk.


The RequireRootedSaveAsPath property of the HttpRuntimeSection is set to true but filename is not an absolute path.

Saving the request context to disk can be useful in debugging.

The following code example calls the SaveAs method when a page is loaded. The call specifies that the request be saved as a text file in a directory where the ASP.NET process identity has been granted write permissions, and that any header information included in the request is included in the file.

No code example is currently available or this language may not be supported.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0