diff --git a/BritishHorseRacingApi/ApiClient.cs b/BritishHorseRacingApi/ApiClient.cs index 2a1994f..b7af5b7 100644 --- a/BritishHorseRacingApi/ApiClient.cs +++ b/BritishHorseRacingApi/ApiClient.cs @@ -18,7 +18,11 @@ namespace BritishHorseRacingApi private const int _waitTimeAfterFail = 5; private const string _userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36"; - public ApiClient(TimeSpan? delay = null) : base(delay) { } + public ApiClient(TimeSpan? delay = null, string cookie = null) : base(delay) + { + if(cookie != null) + _client.DefaultHeaders.Add("Cookie", cookie); + } public static class Endpoints {