GetRequestStreamAsync Method

WebRequest.GetRequestStreamAsync Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

When overridden in a descendant class, returns a Stream for writing data to the Internet resource as an asynchronous operation.

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

'Declaration
Public Overridable Function GetRequestStreamAsync As Task(Of Stream)

Return Value

Type: System.Threading.Tasks.Task(Of Stream)
Returns the Task(Of TResult) representing the asynchronous operation.

After you call GetRequestStreamAsync, make sure you close the request stream before you call GetResponseAsync. Otherwise a System.NotSupportedException is raised.

Windows Phone OS

Supported in: 8.1

Show:
© 2017 Microsoft