/// <summary> /// Initializes a new instance of the <see cref="BountyblokClient"/> class. /// </summary> /// <param name="httpClient">An optional HTTP client which may me injected in order to facilitate testing.</param> /// <param name="options">A <see cref="BountyblokClientOptions"/> instance that defines the configuration settings to use with the client </param> /// <returns>Interface to the bountyblok REST API</returns> internal BountyblokClient(HttpClient httpClient, BountyblokClientOptions options) { this.options = options ?? throw new ArgumentNullException(nameof(options)); this.client = httpClient ?? CreateHttpClientWithRetryHandler(); if (this.options.RequestHeaders != null && this.options.RequestHeaders.TryGetValue(ContentType, out var contentType)) { this.MediaType = contentType; } }
/// <summary> /// Initializes a new instance of the <see cref="BountyblokClient"/> class. /// </summary> /// <param name="options">A <see cref="BountyblokClientOptions"/> instance that defines the configuration settings to use with the client </param> /// <returns>Interface to the bountyblok REST API</returns> public BountyblokClient(BountyblokClientOptions options) : this(null, options) { }