Esempio n. 1
0
 public SpotifyController(SpotifyOptions options, IHubContext <SpotifyHub> hubContext)
 {
     _options    = options;
     _hubContext = hubContext;
     _httpClient = new HttpClient();
     _serializer = new JsonSerializer
     {
         ContractResolver = new CamelCasePropertyNamesContractResolver {
             NamingStrategy = new SnakeCaseNamingStrategy()
         }
     };
     _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(Encoding.UTF8.GetBytes($"{_options.ClientId}:{_options.ClientSecret}")));
 }
Esempio n. 2
0
 public SpotifyHub(SpotifyOptions options)
 {
     _options = options;
 }