示例#1
0
 public SimpleRpcClient(Uri baseUrl, HttpClient httpClient,
                        JsonSerializerSettings jsonSerializerSettings = null)
 {
     if (jsonSerializerSettings == null)
     {
         jsonSerializerSettings = DefaultJsonSerializerSettingsFactory.BuildDefaultJsonSerializerSettings();
     }
     _jsonSerializerSettings = jsonSerializerSettings;
     _httpClient             = httpClient;
     _httpClient.BaseAddress = baseUrl;
 }
示例#2
0
 public RpcClient(Uri baseUrl, AuthenticationHeaderValue authHeaderValue = null,
                  JsonSerializerSettings jsonSerializerSettings          = null, HttpClientHandler httpClientHandler = null, ILog log = null)
 {
     _baseUrl         = baseUrl;
     _authHeaderValue = authHeaderValue;
     if (jsonSerializerSettings == null)
     {
         jsonSerializerSettings = DefaultJsonSerializerSettingsFactory.BuildDefaultJsonSerializerSettings();
     }
     _jsonSerializerSettings = jsonSerializerSettings;
     _httpClientHandler      = httpClientHandler;
     _log = log;
     CreateNewHttpClient();
 }