Compare commits

..
2 Commits
Author SHA1 Message Date
Martin 05856e081a Database backup 2020-04-11 09:57:18 +01:00
Martin b36456da84 Allow port change 2020-03-13 00:14:05 +00:00
2 changed files with 12 additions and 3 deletions
Binary file not shown.
+12 -3
View File
@@ -9,15 +9,24 @@ namespace BritishHorseRacingApi
{ {
public abstract class BaseApiClient public abstract class BaseApiClient
{ {
private const int _startPort = 50010; public int _port = 50010;
protected readonly CustomHttpClient _client = new CustomHttpClient(_startPort); public int Port
{
get { return _port; }
set
{
_port = value;
_client = new CustomHttpClient(_port);
}
}
protected CustomHttpClient _client;
private readonly TimeSpan? _delay; private readonly TimeSpan? _delay;
private DateTime _lastRequest = DateTime.UtcNow; private DateTime _lastRequest = DateTime.UtcNow;
public BaseApiClient(TimeSpan? delay = null) public BaseApiClient(TimeSpan? delay = null)
{ {
_client = new CustomHttpClient(_port);
_delay = delay; _delay = delay;
//_client.DefaultHeaders.Add("Cookie", "bha-ie-test=true; D_SID=188.172.158.138:JT/OEx87nl5ScspTQk38UsDfuIz94DbCf5CYsIC7WpU; _ga=GA1.2.578018316.1549102711; __utmz=36595059.1549187117.8.2.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided); __utma=36595059.578018316.1549102711.1550365414.1551216842.16; __utmc=36595059; D_IID=80C3F85C-C90F-31DF-8830-AF181B9C7A2E; D_UID=33DA8B87-0FB7-3D76-9DA6-A650196A2B16; D_ZID=68EA5585-B6A0-34F7-939A-A0C1B40036B3; D_ZUID=0E647F3A-6570-32D2-9673-8B49FFEBE647; D_HID=EBE66F1F-FA2C-3373-8163-110008C50265");
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12; ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12;
} }