public AbstractWebApiClient(string baseAddress, TokenModel authToken = null)
 {
     _authToken = authToken;
     _client = new HttpClient
     {
         BaseAddress = new Uri(baseAddress)
     };
     _client.DefaultRequestHeaders.Accept.Clear();
     _client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
     if (authToken != null)
     {
         _client.DefaultRequestHeaders.Add("Authorization", string.Format("Bearer {0}", authToken.AccessToken));
     }
 }
Exemplo n.º 2
0
 public GenresClient(string baseUrl, TokenModel token = null)
     : base(baseUrl)
 {
    
 }
        public SoftwaresClient(string baseAddress, TokenModel authToken)
            : base (baseAddress, authToken)
        {

        }