コード例 #1
0
 public static ApiAuthorizer GetAuthorizer(string apiUrl, string authenticationUrl, string api, string secret)
 {
     lock (accessLock)
     {
         if (_authorizers == null)
         {
             _authorizers = new Dictionary <string, ApiAuthorizer>();
         }
         if (_authorizers.ContainsKey(apiUrl))
         {
             return(_authorizers[apiUrl]);
         }
         else
         {
             var authorizer = new ApiAuthorizer(authenticationUrl, api, secret);
             _authorizers.Add(apiUrl, authorizer);
             return(authorizer);
         }
     }
 }
コード例 #2
0
 public BaseServiceClient(string baseUrl, ApiAuthorizer authorizer = null)
 {
     _baseUrl    = baseUrl;
     _client     = new HttpClient();
     _authorizer = authorizer;
 }