/// <summary>
        /// Initializes a new instance of the <see cref="DocumentRoutingODataClientFactory"/> class.
        /// </summary>
        /// <param name="baseUrl">The base URL.</param>
        /// <param name="authorizationProvider">The authorization provider.</param>
        public DocumentRoutingODataClientFactory(Uri baseUrl, IAuthenticationHeaderProvider authorizationProvider)
        {
            this.BaseUrl = baseUrl.ThrowIfNull(nameof(baseUrl));
            this.AuthorizationProvider = authorizationProvider.ThrowIfNull(nameof(authorizationProvider));

            this.BaseUrl = new Uri(this.BaseUrl, DocumentRoutingODataClientFactory.ODataEndPointString);
        }
示例#2
0
 public ReverseDnsClient(IReverseDnsClientConfig config,
                         IAuthenticationHeaderProvider authenticationHeaderProvider,
                         ILogger <ReverseDnsClient> log)
 {
     _config = config;
     _authenticationHeaderProvider = authenticationHeaderProvider;
     _log = log;
 }
示例#3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RestClient" /> class
        /// </summary>
        /// <param name="authorizationHeaderProvider">The authorization header provider.</param>
        public RestClient(IAuthenticationHeaderProvider authorizationHeaderProvider)
        {
            this.authorizationHeaderProvider = authorizationHeaderProvider.ThrowIfNull(nameof(authorizationHeaderProvider));
            this.webClientHandler            = new HttpClientHandler()
            {
                UseCookies = false
            };
            this.webClient = new HttpClient(this.webClientHandler);

            this.webClient.DefaultRequestHeaders.Accept.Clear();
            this.webClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
        }