HttpClient.GetByteArrayAsync HttpClient.GetByteArrayAsync HttpClient.GetByteArrayAsync HttpClient.GetByteArrayAsync Method

定义

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

重载

GetByteArrayAsync(String) GetByteArrayAsync(String) GetByteArrayAsync(String) GetByteArrayAsync(String)

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

GetByteArrayAsync(Uri) GetByteArrayAsync(Uri) GetByteArrayAsync(Uri) GetByteArrayAsync(Uri)

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

注解

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

GetByteArrayAsync(String) GetByteArrayAsync(String) GetByteArrayAsync(String) GetByteArrayAsync(String)

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

public:
 System::Threading::Tasks::Task<cli::array <System::Byte> ^> ^ GetByteArrayAsync(System::String ^ requestUri);
public System.Threading.Tasks.Task<byte[]> GetByteArrayAsync (string requestUri);
member this.GetByteArrayAsync : string -> System.Threading.Tasks.Task<byte[]>
Public Function GetByteArrayAsync (requestUri As String) As Task(Of Byte())

参数

requestUri
String String String String

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

返回

Task<Byte[]>

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

异常

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

注解

不会阻止此操作。This operation will not block. 返回Task<TResult>读取整个响应正文后,将完成对象。The returned Task<TResult> object will complete after the whole response body is read.

GetByteArrayAsync(Uri) GetByteArrayAsync(Uri) GetByteArrayAsync(Uri) GetByteArrayAsync(Uri)

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

public:
 System::Threading::Tasks::Task<cli::array <System::Byte> ^> ^ GetByteArrayAsync(Uri ^ requestUri);
public System.Threading.Tasks.Task<byte[]> GetByteArrayAsync (Uri requestUri);
member this.GetByteArrayAsync : Uri -> System.Threading.Tasks.Task<byte[]>
Public Function GetByteArrayAsync (requestUri As Uri) As Task(Of Byte())

参数

requestUri
Uri Uri Uri Uri

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

返回

Task<Byte[]>

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

异常

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

注解

不会阻止此操作。This operation will not block. 返回Task<TResult>读取整个响应正文后,将完成对象。The returned Task<TResult> object will complete after the whole response body is read.

适用于