HttpClient.GetStreamAsync HttpClient.GetStreamAsync HttpClient.GetStreamAsync HttpClient.GetStreamAsync Method

Definition

将 GET 请求发送到指定 URI 并在异步操作中以流的形式返回响应正文。 Send a GET request to the specified Uri and return the response body as a stream in an asynchronous operation.

Overloads

GetStreamAsync(Uri) GetStreamAsync(Uri) GetStreamAsync(Uri) GetStreamAsync(Uri)

将 GET 请求发送到指定 URI 并在异步操作中以流的形式返回响应正文。 Send a GET request to the specified Uri and return the response body as a stream in an asynchronous operation.

GetStreamAsync(String) GetStreamAsync(String) GetStreamAsync(String) GetStreamAsync(String)

将 GET 请求发送到指定 URI 并在异步操作中以流的形式返回响应正文。 Send a GET request to the specified Uri and return the response body as a stream in an asynchronous operation.

Remarks

不会阻止该操作。The operation will not block.

GetStreamAsync(Uri) GetStreamAsync(Uri) GetStreamAsync(Uri) GetStreamAsync(Uri)

将 GET 请求发送到指定 URI 并在异步操作中以流的形式返回响应正文。 Send a GET request to the specified Uri and return the response body as a stream in an asynchronous operation.

public:
 System::Threading::Tasks::Task<System::IO::Stream ^> ^ GetStreamAsync(Uri ^ requestUri);
public System.Threading.Tasks.Task<System.IO.Stream> GetStreamAsync (Uri requestUri);
member this.GetStreamAsync : Uri -> System.Threading.Tasks.Task<System.IO.Stream>
Public Function GetStreamAsync (requestUri As Uri) As Task(Of Stream)

参数

requestUri
Uri Uri Uri Uri

请求发送到的 URI。 The Uri the request is sent to.

Returns

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

Exceptions

由于基础问题(如网络连接性、DNS 失败、服务器证书验证或超时),请求失败。 The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout.

Remarks

不会阻止此操作。This operation will not block. 返回Task<TResult>对象将完成后读取的响应标头。The returned Task<TResult> object will complete after the response headers are read. 此方法不会不读取操作和缓冲响应正文。This method does not read nor buffer the response body.

GetStreamAsync(String) GetStreamAsync(String) GetStreamAsync(String) GetStreamAsync(String)

将 GET 请求发送到指定 URI 并在异步操作中以流的形式返回响应正文。 Send a GET request to the specified Uri and return the response body as a stream in an asynchronous operation.

public:
 System::Threading::Tasks::Task<System::IO::Stream ^> ^ GetStreamAsync(System::String ^ requestUri);
public System.Threading.Tasks.Task<System.IO.Stream> GetStreamAsync (string requestUri);
member this.GetStreamAsync : string -> System.Threading.Tasks.Task<System.IO.Stream>
Public Function GetStreamAsync (requestUri As String) As Task(Of Stream)

参数

requestUri
String String String String

请求发送到的 URI。 The Uri the request is sent to.

Returns

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

Exceptions

由于基础问题(如网络连接性、DNS 失败、服务器证书验证或超时),请求失败。 The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout.

Remarks

不会阻止此操作。This operation will not block. 返回Task<TResult>对象将完成后读取的响应标头。The returned Task<TResult> object will complete after the response headers are read. 此方法不会不读取操作和缓冲响应正文。This method does not read nor buffer the response body.

Applies to