using System.Net.Http.Headers;

namespace DataSharing.CityStateDataExchange
{
    public static class CityStateDataExchangeHttpClientExtensions
    {
        public static HttpClient BuildHeader(this HttpClient httpClient)
        {
            httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

            return httpClient;
        }

        public static HttpClient SetHttpClient(this HttpClient httpClient, string baseAddress) =>
            httpClient.SetBaseAddress(baseAddress).BuildHeader();
    }
}
