private void Setup(RequestsJsonSerializer jsonSerializer) { // allow tls 1.1 and 1.2 ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; // ReSharper disable once InconsistentlySynchronizedField _requestor = new GitLabApiRequestor(_httpClient, jsonSerializer); _pagedRequestor = new GitLabApiPagedRequestor(_requestor); }
private void Setup(RequestsJsonSerializer jsonSerializer, HttpClient httpClient) { // allow tls 1.1 and 1.2 ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; _httpClient = httpClient; _requestor = new GitLabApiRequestor(_httpClient, jsonSerializer); _pagedRequestor = new GitLabApiPagedRequestor(_requestor); }
private void Setup(RequestsJsonSerializer jsonSerializer) { // allow tls 1.1 and 1.2 ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true; // ReSharper disable once InconsistentlySynchronizedField _requestor = new GitLabApiRequestor(_httpClient, jsonSerializer); _pagedRequestor = new GitLabApiPagedRequestor(_requestor); }
public GitLabHttpFacade(string hostUrl, RequestsJsonSerializer jsonSerializer, string authenticationToken = "") { _httpClient = new HttpClient { BaseAddress = new Uri(hostUrl) }; _httpClient.DefaultRequestHeaders.Add(PrivateToken, authenticationToken); _requestor = new GitLabApiRequestor(_httpClient, jsonSerializer); _pagedRequestor = new GitLabApiPagedRequestor(_requestor); }
public GitLabHttpFacade(string hostUrl, RequestsJsonSerializer jsonSerializer, string authenticationToken = "") { // allow tls 1.1 and 1.2 ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; _httpClient = new HttpClient { BaseAddress = new Uri(hostUrl) }; _httpClient.DefaultRequestHeaders.Add(PrivateToken, authenticationToken); _requestor = new GitLabApiRequestor(_httpClient, jsonSerializer); _pagedRequestor = new GitLabApiPagedRequestor(_requestor); }
public GitLabApiPagedRequestor(GitLabApiRequestor requestor) => _requestor = requestor;