Ejemplo n.º 1
0
        private void configureCredentials(Config config, IRestClient client)
        {
            string username = config.get("http.basicauth.username");
            string password = config.get("http.basicauth.password");

            if (username != null && password != null)
            {
                Credentials defaultCredentials = new Credentials(username, password);
                client.Credentials = defaultCredentials;
            }
        }
Ejemplo n.º 2
0
        private void configureProxy(Config config, IRestClient client)
        {
            string proxyHost = config.get("http.proxy.host");

            if (proxyHost != null)
            {
                int       proxyPort     = config.getAsInteger("http.proxy.port", DEFAULT_PROXY_PORT);
                string    proxyUserName = config.get("http.proxy.username");
                string    proxyPassword = config.get("http.proxy.password");
                string    proxyDomain   = config.get("http.proxy.domain");
                ProxyInfo proxyInfo
                             = new ProxyInfo(proxyHost, proxyPort, proxyUserName, proxyPassword, proxyDomain);
                client.Proxy = proxyInfo;
            }
        }