Example #1
0
        /// <summary>
        /// Every web request requires a secret Steam Web API key
        /// </summary>
        /// <param name="steamWebApiBaseUrl">Base URL for the API (such as http://api.steampowered.com)</param>
        /// <param name="steamWebApiKey">Secret Steam Web API key provided at the Valve developer website</param>
        /// <param name="httpClient">Optional custom http client implementation for dependency injection</param>
        public SteamWebRequest(string steamWebApiBaseUrl, string steamWebApiKey, ISteamWebHttpClient httpClient = null)
        {
            this.httpClient = httpClient == null ? new SteamWebHttpClient() : httpClient;

            if (String.IsNullOrWhiteSpace(steamWebApiBaseUrl))
            {
                throw new ArgumentNullException("steamWebApiBaseUrl");
            }

            if (String.IsNullOrWhiteSpace(steamWebApiKey))
            {
                throw new ArgumentNullException("steamWebApiKey");
            }

            this.steamWebApiBaseUrl = steamWebApiBaseUrl;
            this.steamWebApiKey     = steamWebApiKey;
        }
Example #2
0
        /// <summary>
        /// Every web request requires a secret Steam Web API key
        /// </summary>
        /// <param name="steamWebApiBaseUrl">Base URL for the API (such as http://api.steampowered.com)</param>
        /// <param name="steamWebApiKey">Secret Steam Web API key provided at the Valve developer website</param>
        /// <param name="steamWebHttpClient">Optional custom http client implementation for dependency injection</param>
        public SteamWebRequest(string steamWebApiBaseUrl, string steamWebApiKey, ISteamWebHttpClient steamWebHttpClient)
        {
            if (String.IsNullOrWhiteSpace(steamWebApiBaseUrl))
            {
                throw new ArgumentNullException(nameof(steamWebApiBaseUrl));
            }

            if (String.IsNullOrWhiteSpace(steamWebApiKey))
            {
                throw new ArgumentNullException(nameof(steamWebApiKey));
            }

            if (steamWebHttpClient == null)
            {
                throw new ArgumentNullException(nameof(steamWebHttpClient));
            }

            this.steamWebApiBaseUrl = steamWebApiBaseUrl;
            this.steamWebApiKey     = steamWebApiKey;
            this.steamWebHttpClient = steamWebHttpClient;
        }