 | HttpClientExtensionsGetByteArraySafeAsync Method (HttpClient, Uri, ArgDictionary, LogActivity) |
Sends a GET to a specified
Uri and returns the response body as a byte array ensuring that the operation succeeded.
Namespace:
System.Net.Http
Assembly:
Neon.Common (in Neon.Common.dll) Version: 2.10.0
Syntaxpublic static Task<byte[]> GetByteArraySafeAsync(
this HttpClient client,
Uri requestUri,
ArgDictionary headers = null,
LogActivity activity = null
)
<ExtensionAttribute>
Public Shared Function GetByteArraySafeAsync (
client As HttpClient,
requestUri As Uri,
Optional headers As ArgDictionary = Nothing,
Optional activity As LogActivity = Nothing
) As Task(Of Byte())
public:
[ExtensionAttribute]
static Task<array<unsigned char>^>^ GetByteArraySafeAsync(
HttpClient^ client,
Uri^ requestUri,
ArgDictionary^ headers = nullptr,
LogActivity activity = nullptr
)
[<ExtensionAttribute>]
static member GetByteArraySafeAsync :
client : HttpClient *
requestUri : Uri *
?headers : ArgDictionary *
?activity : LogActivity
(* Defaults:
let _headers = defaultArg headers null
let _activity = defaultArg activity null
*)
-> Task<byte[]>
Parameters
- client
- Type: System.Net.HttpHttpClient
The client. - requestUri
- Type: SystemUri
The request URI. - headers (Optional)
- Type: Neon.CollectionsArgDictionary
Optional request headers. - activity (Optional)
- Type: Neon.DiagnosticsLogActivity
Optional LogActivity whose ID is to be included in the request.
Return Value
Type:
TaskByteThe response byte array.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
HttpClient. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
Exceptions
See Also