Table of Contents

Class HttpClientRequestSender

Namespace
Xping.Sdk.Actions
Assembly
Xping.Sdk.dll

The HttpClientRequestSender class is a concrete implementation of the TestComponent class that is used to send an HTTP request. It uses the IHttpClientFactory to create an instance of the HttpClient class, which is used to send the HTTP request.

public sealed class HttpClientRequestSender : TestComponent, ITestComponent
Inheritance
HttpClientRequestSender
Implements
Inherited Members

Remarks

Before using this test component, you need to register the necessary services by calling the AddHttpClientFactory() method.

Constructors

HttpClientRequestSender(HttpClientConfiguration)

Initializes a new instance of the HttpClientRequestSender class with the specified configuration.

public HttpClientRequestSender(HttpClientConfiguration configuration)

Parameters

configuration HttpClientConfiguration

The HttpClient configuration.

Methods

HandleAsync(Uri, TestSettings, TestContext, IServiceProvider, CancellationToken)

This method performs the test step operation asynchronously.

public override Task HandleAsync(Uri url, TestSettings settings, TestContext context, IServiceProvider serviceProvider, CancellationToken cancellationToken = default)

Parameters

url Uri

A Uri object that represents the URL of the page being validated.

settings TestSettings

A TestSettings object that contains the settings for the test.

context TestContext

A TestContext object that represents the test context.

serviceProvider IServiceProvider

An instance object of a mechanism for retrieving a service object.

cancellationToken CancellationToken

An optional CancellationToken object that can be used to cancel this operation.

Returns

Task

TestStep object.