WebRequest.GetRequestStreamAsync WebRequest.GetRequestStreamAsync WebRequest.GetRequestStreamAsync WebRequest.GetRequestStreamAsync Method

定义

当在子类中被重写时,将用于写入数据的 Stream 作为异步操作返回到 Internet 资源。When overridden in a descendant class, returns a Stream for writing data to the Internet resource as an asynchronous operation.

public:
 virtual System::Threading::Tasks::Task<System::IO::Stream ^> ^ GetRequestStreamAsync();
public virtual System.Threading.Tasks.Task<System.IO.Stream> GetRequestStreamAsync ();
abstract member GetRequestStreamAsync : unit -> System.Threading.Tasks.Task<System.IO.Stream>
override this.GetRequestStreamAsync : unit -> System.Threading.Tasks.Task<System.IO.Stream>
Public Overridable Function GetRequestStreamAsync () As Task(Of Stream)

返回

表示异步操作的任务对象。The task object representing the asynchronous operation.

注解

此操作不会阻止。This operation will not block. 当向Task<TResult> Internet 资源写入数据时,返回的对象将会完成。StreamThe returned Task<TResult> object will complete when the Stream for writing data to the Internet resource is available.

调用GetRequestStreamAsync后,请确保在调用GetResponseAsync之前关闭请求流。After you call GetRequestStreamAsync, make sure you close the request stream before you call GetResponseAsync.

适用于