示例#1
0
        private ForceClient CreateForceClient(AuthenticationClient auth)
        {
            var client     = new ForceClient(auth.InstanceUrl, auth.AccessToken, auth.ApiVersion);
            var httpClient = client.GetHttpClient();
            var handler    = typeof(HttpMessageInvoker).GetField("_handler", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).GetValue(httpClient) as HttpClientHandler;

            handler.AutomaticDecompression = System.Net.DecompressionMethods.GZip | System.Net.DecompressionMethods.Deflate | System.Net.DecompressionMethods.None;

            return(client);
        }