using Mozu.Api.Test.Helpers; using System.Net.Http; var httpClient = new HttpClient(new ServiceClientMessageHandler()) { BaseAddress = new Uri("https://example.com") };
using Mozu.Api.Test.Helpers; using System.Net.Http; var handler = new ServiceClientMessageHandler(); handler.OnOutgoingRequest = request => { request.Headers.Add("X-Custom-Header", "123"); }; var httpClient = new HttpClient(handler) { BaseAddress = new Uri("https://example.com") }; var response = await httpClient.GetAsync("api/test");In this example, we create a new `ServiceClientMessageHandler` and set the `OnOutgoingRequest` property to a lambda function that adds a custom header to each outgoing request. We then pass this handler to the `HttpClient` constructor and use it to make an HTTP GET request. The resulting `HttpResponseMessage` will contain the custom header we added in the `OnOutgoingRequest` function. Overall, the `Mozu.Api.Test.Helpers` package library provides a useful toolset for testing and mocking API requests and responses.