Exemplo n.º 1
0
        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;
                }
            }
        }
Exemplo n.º 2
0
        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";
        }
Exemplo n.º 3
0
        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";
        }