You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 10, 2018. It is now read-only.
Is there an easy way to replace the HttpClientFactory on the client so it uses ModernHttpClient's NativeMessageHandler?
This is my initial stab at integrating it but I didn't see a way to set the _proxyProperty from the DefaultHttpClientFactory the same way it did.
/// <summary>/// An HTTP Client Factory that uses the high-performance ModernHttpClient's NativeMessageHandler to process requests./// </summary>publicclassModernHttpClientFactory:DefaultHttpClientFactory{
#region Methods
/// <summary>/// Create the message handler./// </summary>/// <param name="client">The REST client that wants to create the HTTP client</param>/// <param name="request">The REST request for which the HTTP client is created</param>/// <returns>/// A new HttpMessageHandler object/// </returns>protectedoverrideHttpMessageHandlerCreateMessageHandler(IRestClientclient,IRestRequestrequest){varproxy=GetProxy(client);varcookies=GetCookies(client,request);varcredentials=client.Credentials;varhttpClientHandler=newNativeMessageHandler();if(httpClientHandler.SupportsProxy&&proxy!=null){httpClientHandler.UseProxy=true;httpClientHandler.Proxy=newRequestProxyWrapper(proxy);;}if(cookies!=null){httpClientHandler.UseCookies=true;httpClientHandler.CookieContainer=cookies;}if(credentials!=null){httpClientHandler.Credentials=credentials;}returnhttpClientHandler;}
#endregion
}
Is there an easy way to replace the HttpClientFactory on the client so it uses ModernHttpClient's NativeMessageHandler?
This is my initial stab at integrating it but I didn't see a way to set the _proxyProperty from the DefaultHttpClientFactory the same way it did.