Table of Contents

Class XpingApiClient

Namespace
Xping.Sdk.Core.Upload
Assembly
Xping.Sdk.Core.dll

HTTP client for uploading test executions to the Xping API with resilience policies.

public sealed class XpingApiClient : ITestResultUploader, IDisposable
Inheritance
XpingApiClient
Implements
Inherited Members

Constructors

XpingApiClient(HttpClient, XpingConfiguration, IXpingSerializer?, IXpingLogger?)

Initializes a new instance of the XpingApiClient class.

public XpingApiClient(HttpClient httpClient, XpingConfiguration config, IXpingSerializer? serializer = null, IXpingLogger? logger = null)

Parameters

httpClient HttpClient

The HTTP client to use for API calls.

config XpingConfiguration

The Xping configuration.

serializer IXpingSerializer

Optional serializer. If not provided, uses default XpingJsonSerializer with ApiOptions.

logger IXpingLogger

Optional logger for diagnostics. If null, uses NullLogger.

Methods

Dispose()

Disposes the HTTP client resources.

public void Dispose()

UploadAsync(IEnumerable<TestExecution>, CancellationToken)

Uploads a batch of test executions to the Xping API. If the upload fails, an error is logged.

public Task<UploadResult> UploadAsync(IEnumerable<TestExecution> executions, CancellationToken cancellationToken = default)

Parameters

executions IEnumerable<TestExecution>

The test executions to upload.

cancellationToken CancellationToken

A cancellation token to cancel the operation.

Returns

Task<UploadResult>

A task containing the upload result.