Basic configuration
var services = new ServiceCollection();
services.AddHubSpot(hs =>
{
// ... here goes the configuration part.
});Configure the HubSpot client
services.AddHubSpot(hs =>
{
hs.ConfigureHubSpotClient(client => client
.SetBaseAddress(new Uri("https://localhost.temp"))
.UseOAuthAuthentication(configuration.GetSection("HubSpot"))
.ConfigureSerialization(settings => settings.Formatting = Newtonsoft.Json.Formatting.Indented)
.ConfigureHttpClient(http => http.DefaultRequestHeaders.Add("X-CustomHeader", "my value"))
.ConfigureHttpClientBuilder(builder => builder
.AddHttpMessageHandler<HttpClientXRayTracingHandler>()
.AddPolicyHandler(GetRetryPolicy())));
});Authentication
Last updated