PIbd-23_Elatomtsev_L.K._Cou.../Bank/BankWorkerApp/APIClient.cs

19 lines
610 B
C#
Raw Normal View History

using BankContracts.ViewModels;
using System.Net.Http.Headers;
namespace BankWorkerApp
{
public static class APIClient
{
private static readonly HttpClient _worker = new();
public static WorkerViewModel? Worker { get; set; } = null;
public static void Connect(IConfiguration configuration)
{
_worker.BaseAddress = new Uri(configuration["IPAddress"]);
_worker.DefaultRequestHeaders.Accept.Clear();
_worker.DefaultRequestHeaders.Accept.Add(new
MediaTypeWithQualityHeaderValue("application/json"));
}
}
}