Ejemplo n.º 1
0
 public TwitchOAuthClient(string clientId, string clientSecret)
 {
     _clientId     = clientId;
     _clientSecret = clientSecret;
     _api          = new RestClient("https://id.twitch.tv")
     {
         JsonSerializerSettings = new JsonSerializerSettings()
         {
             ContractResolver = new DefaultContractResolver()
             {
                 NamingStrategy = new SnakeCaseNamingStrategy()
             }
         }
     }.For <TwitchOAuthAPI>();
 }
        public TwitchOAuthClient(string clientId, string clientSecret)
        {
            _clientId     = clientId;
            _clientSecret = clientSecret;

            var httpClient = new HttpClient()
            {
                BaseAddress = new Uri("https://id.twitch.tv"),
            };

            _api = RestService.For <TwitchOAuthAPI>(
                httpClient,
                new RefitSettings
            {
                ContentSerializer = new JsonContentSerializer(JsonSerializationConfig),
            });
        }