Freigeben über


FaceSessionClient.GetSessionImageAsync Method

Definition

Overloads

GetSessionImageAsync(String, CancellationToken)

Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-session-image for more details.

GetSessionImageAsync(String, RequestContext)

[Protocol Method] Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-session-image for more details.

GetSessionImageAsync(String, CancellationToken)

Source:
FaceSessionClient.cs
public virtual System.Threading.Tasks.Task<Azure.Response<BinaryData>> GetSessionImageAsync (string sessionImageId, System.Threading.CancellationToken cancellationToken = default);
abstract member GetSessionImageAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<BinaryData>>
override this.GetSessionImageAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<BinaryData>>
Public Overridable Function GetSessionImageAsync (sessionImageId As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of BinaryData))

Parameters

sessionImageId
String

The request ID of the image to be retrieved.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

sessionImageId is null.

sessionImageId is an empty string, and was expected to be non-empty.

Examples

This sample shows how to call GetSessionImageAsync.

Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
FaceSessionClient client = new FaceSessionClient(endpoint, credential);

Response<BinaryData> response = await client.GetSessionImageAsync("3d035d35-2e01-4ed4-8935-577afde9caaa");

Applies to

GetSessionImageAsync(String, RequestContext)

Source:
FaceSessionClient.cs

[Protocol Method] Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-session-image for more details.

public virtual System.Threading.Tasks.Task<Azure.Response> GetSessionImageAsync (string sessionImageId, Azure.RequestContext context);
abstract member GetSessionImageAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetSessionImageAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetSessionImageAsync (sessionImageId As String, context As RequestContext) As Task(Of Response)

Parameters

sessionImageId
String

The request ID of the image to be retrieved.

context
RequestContext

The request context, which can override default behaviors of the client pipeline on a per-call basis.

Returns

The response returned from the service.

Exceptions

sessionImageId is null.

sessionImageId is an empty string, and was expected to be non-empty.

Service returned a non-success status code.

Examples

This sample shows how to call GetSessionImageAsync and parse the result.

Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
FaceSessionClient client = new FaceSessionClient(endpoint, credential);

Response response = await client.GetSessionImageAsync("3d035d35-2e01-4ed4-8935-577afde9caaa", null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());

Applies to