Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

HttpRequest.InputStream Property

Gets the contents of the incoming HTTP entity body.

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

No code example is currently available or this language may not be supported.
/** @property */
public Stream get_InputStream ()

public function get InputStream () : Stream

Property Value

A Stream object representing the contents of the incoming HTTP content body.

The following code example copies the contents of an InputStream into a string.

var str : Stream
var sb : StringBuilder = new StringBuilder()
var strmContents : String
var strLen, strRead : int

str = Request.InputStream             // Create a Stream object.
strLen = str.Length                   // Find number of Bytes in stream.
var strArr: Byte[] = new Byte[strLen] // Create a Byte array.
strRead = str.Read(strArr,0,strLen)   // Read stream into Byte array.

// Convert Byte array to a text string.
for(var counter=0; counter < strLen; counter++){
strmContents = sb.ToString();

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

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

.NET Framework

Supported in: 2.0, 1.1, 1.0

Community Additions

© 2015 Microsoft