UnityWebRequestExt.Read Method
Reads bytes asynchronously from an URI.
Namespace: UltimateXR.Extensions.Unity.IO
Assembly: UltimateXR (in UltimateXR.dll) Version: 0.0.0.0
Syntax
C#
public static Task<byte[]> Read(
string uri,
CancellationToken ct = default
)
Parameters
- uri
- Type: System.String
Location of the data - ct (Optional)
- Type: System.Threading.CancellationToken
Optional cancellation token, to cancel the operation
Return Value
Type: Task(Byte[])
Awaitable task that returns the bytes read
Exceptions
Exception | Condition |
---|---|
OperationCanceledException | The task was canceled using ct |
HttpUwrException | HttpError flag is on |
NetUwrException | NetworkError flag is on |
See Also
Reference
UnityWebRequestExt Class
UltimateXR.Extensions.Unity.IO Namespace