private void setupRequest(string serverUrl, HttpWebRequest request) { if (Proxy != null) { request.Proxy = Proxy; } // Support authentication in case url is ABBYY SDK // Warning! Please read the important note in BasicRequestAuthSetup.Run() // before trying to reimplement Basic authentication if (serverUrl.StartsWith(ServerUrl, StringComparison.InvariantCultureIgnoreCase)) { RequestAuthSetup.Run(request, ApplicationId, Password); } // Set user agent string so that the service is able to collect statistics { var userAgentStoredSetting = System.Configuration.ConfigurationManager.AppSettings["HttpClientUserAgent"]; if (String.IsNullOrEmpty(userAgentStoredSetting)) { request.UserAgent = ".NET Cloud OCR SDK Client"; } else { request.UserAgent = userAgentStoredSetting; } } }
private void setupRequest(string serverUrl, WebRequest request) { if (Proxy != null) { request.Proxy = Proxy; } // Support authentication in case url is ABBYY SDK if (serverUrl.StartsWith(ServerUrl, StringComparison.InvariantCultureIgnoreCase)) { RequestAuthSetup.Run(request, ApplicationId, Password); } // Set user agent string so that server is able to collect statistics ((HttpWebRequest)request).UserAgent = ".Net Cloud OCR SDK client"; }
private void setupRequest(string serverUrl, HttpWebRequest request) { if (Proxy != null) { request.Proxy = Proxy; } // Support authentication in case url is ABBYY SDK // Warning! Please read the important note in BasicRequestAuthSetup.Run() // before trying to reimplement Basic authentication if (serverUrl.StartsWith(ServerUrl, StringComparison.InvariantCultureIgnoreCase)) { RequestAuthSetup.Run(request, ApplicationId, Password); } // Set user agent string so that server is able to collect statistics request.UserAgent = ".Net Cloud OCR SDK client"; }