19 lines
610 B
C#
19 lines
610 B
C#
|
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"));
|
|||
|
}
|
|||
|
}
|
|||
|
}
|