Skip to content

Latest commit

 

History

History
33 lines (19 loc) · 1.03 KB

File metadata and controls

33 lines (19 loc) · 1.03 KB

.NET Configuration Extensions for using a RESTful endpoint

Nuget

CI

dotnet add package OLT.Extensions.Configuration.RESTApi
using OLT.Extensions.Configuration.RESTApi;

var builder = WebApplication.CreateBuilder(args);

builder.Configuration
    .SetBasePath(builder.Environment.ContentRootPath)
    .AddRestApi("https://my-configuration-endpoint/config/application", false, TimeSpan.FromMinutes(10),  options =>
            {
                options
                    .SetHeaderAcceptJson()
                    .SetQueryParam("env", "staging")
                    .UseAuthentication(auth => auth.WithApiKey(apiKey, "X-API-KEY"));

            });