Skip to content

[🚀 Feature]: [dotnet] Expose HttpClient initialization in HttpCommandExecutor to make it possible for overriding #15280

Closed
@nvborisenko

Description

@nvborisenko

Feature and motivation

HttpCommandExecutor entirely closed for any overriding to create HttpClient:

private HttpClient CreateHttpClient()

It will be good to make it protected virtual. Proposed API:

protected virtual HttpClientHandler CreateHttpClientHandler()
protected virtual HttpClient CreateHttpClient()

It also exposes initialization of HttpClientHandler to make it possible to customize it, like ignoring certificate validation (appium/dotnet-client#455).

Usage example

class MyHttpCommandExecutor : HttpCommandExecutor
{
  override CreateHttpClientHandler()
  {
    var handler = base.CreateHttpClientHandler();
    handler.SomeProperty = "abc";
    return handler;
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-needs-triagingA Selenium member will evaluate this soon!C-dotnet.NET BindingsI-enhancementSomething could be better

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions