Example #1
0
        protected RedditApi(string url, RedditHttpClientHandler clientHandler)
        {
            _clientHandler = clientHandler ?? new RedditHttpClientHandler(null);

            Client = new HttpClient(_clientHandler)
            {
                BaseAddress = new Uri(url)
            };
            Client.DefaultRequestHeaders.Add("User-Agent", "RedditNET/1.0 (by /u/mitch528)");

            SerializerSettings = new JsonSerializerSettings
            {
                Converters = new List <JsonConverter>
                {
                    new ThingConverter(this)
                }
            };
        }
Example #2
0
 public RedditApi(RedditHttpClientHandler clientHandler) : this(UrlConstants.RedditBaseOAuthApiUrl, clientHandler)
 {
 }