Recommendations for HTTPClient

Learn about a recommended method to creating an instance of HttpClient

Last published at: May 12th, 2026

We have a custom assembly for data types and custom steps that are placed in the FlowWright directory. In both cases, they call back to the application’s REST API. You may encounter some difficulties with a few dependencies.

Most Microsoft examples use dependency injection to inject an IHttpClientFactory instance. 

Here's an example of using the HTTP Client to access data types and/or process steps with an HTTP context. 
 

using System;
using System.Net.Http;
using System.Threading.Tasks;

namespace HttpClientExample
{
    class Program
    {
        static async Task Main(string[] args)
        {
            using (HttpClient client = new HttpClient())
            {
                try
                {
                    HttpResponseMessage response = await client.GetAsync("https://api.example.com/data");
                    response.EnsureSuccessStatusCode();

                    string responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine(responseBody);
                }
                catch (HttpRequestException e)
                {
                    Console.WriteLine($"Request error: {e.Message}");
                }
            }
        }
    }
}

 

Here's a recommended method to create an instance of HttpClient in FlowWright v10.x. 

Create a folder under the C:\FlowWright directory and place your dll there. Then configure that directory in the appsettings.json file. There is an item called “CustomUIDllsFolder”; enter the name of your folder there, and the dlls will be automatically loaded when the app starts.