Ejemplo n.º 1
0
 protected WebDriverFactoryBase(WebBrowserId webBrowserId, IHttpWebRequestFactory httpWebRequestFactory, IWebDriverOptions webDriverOptions, IWebDriverFactoryOptions webDriverFactoryOptions)
 {
     this.webBrowserId            = webBrowserId;
     this.httpWebRequestFactory   = httpWebRequestFactory;
     this.webDriverOptions        = webDriverOptions;
     this.webDriverFactoryOptions = webDriverFactoryOptions;
 }
        public Object QueryDuoApi(IHttpWebRequestFactory webRequestFactory, string protocol, string path, HttpWebRequestMethod method, IEnumerable<KeyValuePair<string, string>> queryValues)
        {
            var duoWebRequest = CreateSignedDuoWebRequest(webRequestFactory, protocol, path, method, queryValues);

            try
            {
                var duoResponse = duoWebRequest.GetResponse();

                if (duoResponse != null)
                {
                    var responseStream = duoResponse.GetResponseStream();
                    if (responseStream != null)
                    {
                        using (var reader = new StreamReader(responseStream))
                        {
                            var js = new JavaScriptSerializer();
                            var objText = reader.ReadToEnd();
                            return js.DeserializeObject(objText);
                        }
                    }
                }
            }
            catch (WebException exception)
            {
                return null;
            }
            return null;
        }
Ejemplo n.º 3
0
 public MirthConnectRequest(IHttpWebRequestFactory httpRequestFactory, string url)
 {
     this.httpRequestFactory = httpRequestFactory;
     this.url           = url;
     this.postData      = new Dictionary <string, string>();
     this.UrlParameters = new Dictionary <string, string>();
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ExchangeListenerManager"/> class.
 /// </summary>
 /// <param name="userConnection"><see cref="UserConnection"/> instance.</param>
 public ExchangeListenerManager(UserConnection userConnection)
 {
     UserConnection  = userConnection;
     _requestFactory = ClassFactory.Get <IHttpWebRequestFactory>();
     _mailboxService = ClassFactory.Get <IMailboxService>(new ConstructorArgument("uc", userConnection));
     _log            = ClassFactory.Get <ISynchronizationLogger>(new ConstructorArgument("userId", userConnection.CurrentUser.Id));
 }
Ejemplo n.º 5
0
 public SolrCore(string id, Type documentType, string url, IHttpWebRequestFactory httpWebRequestFactory)
 {
     Id = id;
     DocumentType = documentType;
     Url = url;
     HttpWebRequestFactory = httpWebRequestFactory;
 }
Ejemplo n.º 6
0
        // Protected members

        protected override Uri GetWebDriverUri(IWebBrowserInfo webBrowserInfo, IHttpWebRequestFactory webRequestFactory)
        {
            // Note that Edge and EdgeHTML use different web drivers-- MicrosoftEdgeDriver.exe and msedgedriver.exe, respectively.
            // The latest version of EdgeHTML is 18.19041, so that can be used to determine which web driver to download.
            // Currently, this method only gets web driver URIs for Edge, and not EdgeHTML.

            string edgeMajorVersionStr = webBrowserInfo.Version.Major.ToString(CultureInfo.InvariantCulture);

            // We'll get an XML document listing all web driver versions available for this version of Edge.
            // There might not be one for this specific version, so we'll pick the closest.

            using (IWebClient client = webRequestFactory.CreateWebClient()) {
                int    maxResults  = 999;
                string responseXml = client.DownloadString($"https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver?prefix={edgeMajorVersionStr}&delimiter=%2F&maxresults={maxResults}&restype=container&comp=list");

                string webDriverVersionStr = Regex.Matches(responseXml, @"<Name>([\d.]+)", RegexOptions.IgnoreCase).Cast <Match>()
                                             .Select(m => m.Groups[1].Value) // version strings
                                             .OrderByDescending(versionString => CountMatchingRevisions(versionString, edgeMajorVersionStr))
                                             .ThenByDescending(versionString => versionString, new NaturalSortComparer())
                                             .FirstOrDefault();

                if (string.IsNullOrWhiteSpace(webDriverVersionStr))
                {
                    webDriverVersionStr = edgeMajorVersionStr;
                }

                return(new Uri($"https://msedgedriver.azureedge.net/{webDriverVersionStr}/edgedriver_{GetPlatformOS()}.zip"));
            }
        }
Ejemplo n.º 7
0
        // Protected members

        protected override Uri GetWebDriverUri(IWebBrowserInfo webBrowserInfo, IHttpWebRequestFactory webRequestFactory)
        {
            Uri versionUri = new Uri("https://chromedriver.storage.googleapis.com/LATEST_RELEASE");

            // If we can get the current version of Google Chrome, we can select an exact web driver version.

            Version browserVersion = webBrowserInfo?.Version;

            if (browserVersion is object)
            {
                versionUri = new Uri(versionUri.AbsoluteUri + $"_{browserVersion.Major}.{browserVersion.Minor}.{browserVersion.Build}");
            }

            using (IWebClient webClient = webRequestFactory.ToWebClientFactory().Create()) {
                // Get the latest web driver version.

                string latestVersionString = webClient.DownloadString(versionUri);

                // Create a download URL for this version.

                if (!string.IsNullOrWhiteSpace(latestVersionString))
                {
                    Uri downloadUri = new Uri(versionUri, $"/{latestVersionString}/chromedriver_{GetPlatformOS()}.zip");

                    return(downloadUri);
                }
            }

            // We weren't able to get information on the latest web driver.

            return(null);
        }
Ejemplo n.º 8
0
 /// <summary>
 /// Manages HTTP connection with Solr
 /// </summary>
 /// <param name="serverURL">URL to Solr</param>
 public SolrConnection(string serverURL)
 {
     ServerURL             = serverURL;
     Timeout               = -1;
     Cache                 = new NullCache();
     HttpWebRequestFactory = new HttpWebRequestFactory();
 }
Ejemplo n.º 9
0
 public OAuthHttpWebRequest(IHttpWebRequestFactory httpWebRequestFactory, OAuthWebRequestSigner signer)
 {
     _httpWebRequestFactory = httpWebRequestFactory;
     _signer     = signer;
     Timeout     = int.MinValue;
     Compression = DecompressionMethods.None;
 }
 public OAuthHttpWebRequest(IHttpWebRequestFactory httpWebRequestFactory, OAuthWebRequestSigner signer)
 {
     _httpWebRequestFactory = httpWebRequestFactory;
     _signer = signer;
     Timeout = int.MinValue;
     Compression = DecompressionMethods.None;
 }
Ejemplo n.º 11
0
 public TargetedNotificationsProvider(RemoteSettingsInitializer initializer)
     : base(initializer.CacheableRemoteSettingsStorageHandler, initializer)
 {
     webRequestFactory            = initializer.HttpWebRequestFactory;
     notificationsParser          = initializer.TargetedNotificationsParser;
     remoteSettingsFilterProvider = initializer.FilterProvider;
 }
Ejemplo n.º 12
0
        protected WebClientBase(IHttpWebRequestFactory webRequestFactory)
        {
            this.webRequestFactory = webRequestFactory;

            // Replace the default proxy with a placeholder, so we can detect if the user has changed the proxy property.
            // This would not be necessary if we could override the Proxy property, but alas, we cannot.

            Proxy = new PlaceholderWebProxy(Proxy);
        }
Ejemplo n.º 13
0
        // Public members

        public RedirectHandler(IHttpWebRequestFactory httpWebRequestFactory)
        {
            if (httpWebRequestFactory is null)
            {
                throw new ArgumentNullException(nameof(httpWebRequestFactory));
            }

            this.httpWebRequestFactory = httpWebRequestFactory;
        }
Ejemplo n.º 14
0
        public WebClientFactory(IHttpWebRequestFactory webRequestFactory, WebRequestHandler webRequestHandler) :
            this(webRequestFactory) {
            if (webRequestHandler is null)
            {
                throw new ArgumentNullException(nameof(webRequestHandler));
            }

            this.webRequestHandler = webRequestHandler;
        }
Ejemplo n.º 15
0
        public WebClientFactory(IHttpWebRequestFactory webRequestFactory)
        {
            if (webRequestFactory is null)
            {
                throw new ArgumentNullException(nameof(webRequestFactory));
            }

            this.webRequestFactory = webRequestFactory;
        }
Ejemplo n.º 16
0
 public OAuthHttpWebRequest()
 {
     _httpWebRequestFactory = new StandardHttpWebRequestFactory();
     _signer            = new OAuthWebRequestSigner(new HmacSha1SignatureGenerator());
     TimestampGenerator = new StandardTimestampGenerator();
     NonceGenerator     = new GuidNonceGenerator();
     Timeout            = int.MinValue;
     Compression        = DecompressionMethods.None;
 }
 public OAuthHttpWebRequest()
 {
     _httpWebRequestFactory = new StandardHttpWebRequestFactory();
     _signer = new OAuthWebRequestSigner(new HmacSha1SignatureGenerator());
     TimestampGenerator = new StandardTimestampGenerator();
     NonceGenerator = new GuidNonceGenerator();
     Timeout = int.MinValue;
     Compression = DecompressionMethods.None;
 }
Ejemplo n.º 18
0
        // Protected members

        protected WebClientBase(IHttpWebRequestFactory webRequestFactory)
        {
            this.webRequestFactory = webRequestFactory;

            // The Proxy property is non-null by default, and we want to know if the user set the proxy to a blank proxy intentionally.
            // Instead of trying to figure that out, we'll set the Proxy property here, and assume that whatever the property is from hereon out is what the user wants.

            webRequestFactory.GetOptions().CopyTo(this);
        }
Ejemplo n.º 19
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="encodingfactory"></param>
        /// <param name="httpWebRequestFactory"></param>
        /// <param name="transmissionLogger"></param>
        public HttpTransmitter(IEncodingFactory encodingfactory, IHttpWebRequestFactory httpWebRequestFactory, ITransmissionLogger transmissionLogger) {
            ParameterCheck.ParameterRequired(encodingfactory, "encodingfactory");
            ParameterCheck.ParameterRequired(httpWebRequestFactory, "httpWebRequestFactory");
            ParameterCheck.ParameterRequired(transmissionLogger, "transmissionLogger");

            this.encodingfactory = encodingfactory;
            this.httpWebRequestFactory = httpWebRequestFactory;
            this.transmissionLogger = transmissionLogger;
        }
Ejemplo n.º 20
0
        public EncodingHelper(IHttpWebRequestFactory webRequestFactory)
        {
            if (webRequestFactory == null)
            {
                throw new ArgumentNullException(nameof(webRequestFactory));
            }

            _webRequestFactory = webRequestFactory;
        }
Ejemplo n.º 21
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="encodingfactory"></param>
        /// <param name="httpWebRequestFactory"></param>
        /// <param name="transmissionLogger"></param>
        public HttpTransmitter(IEncodingFactory encodingfactory, IHttpWebRequestFactory httpWebRequestFactory, ITransmissionLogger transmissionLogger)
        {
            ParameterCheck.ParameterRequired(encodingfactory, "encodingfactory");
            ParameterCheck.ParameterRequired(httpWebRequestFactory, "httpWebRequestFactory");
            ParameterCheck.ParameterRequired(transmissionLogger, "transmissionLogger");

            this.encodingfactory       = encodingfactory;
            this.httpWebRequestFactory = httpWebRequestFactory;
            this.transmissionLogger    = transmissionLogger;
        }
Ejemplo n.º 22
0
 public AFDFlightsProvider(IKeyValueStorage keyValueStorage, string flightsKey, IFlightsStreamParser flightsStreamParser, IExperimentationFilterProvider filterProvider, IHttpWebRequestFactory httpWebRequestFactory)
     : base(keyValueStorage, flightsStreamParser, 1800000)
 {
     CodeContract.RequiresArgumentNotNullAndNotEmpty(flightsKey, "flightsKey");
     CodeContract.RequiresArgumentNotNull <IExperimentationFilterProvider>(filterProvider, "filterProvider");
     CodeContract.RequiresArgumentNotNull <IHttpWebRequestFactory>(httpWebRequestFactory, "httpWebRequestFactory");
     this.filterProvider        = filterProvider;
     this.flightsKey            = flightsKey;
     this.httpWebRequestFactory = httpWebRequestFactory;
 }
        public RandomOrgApiService(ISettingsManager settingsManager = null, IHttpWebRequestFactory httpWebRequestFactory = null)
        {
            _httpWebRequestFactory = httpWebRequestFactory ?? new HttpWebRequestFactory();
            if (settingsManager == null)
                settingsManager = new SettingsManager(new ConfigurationManagerWrap());

            _url = settingsManager.GetUrl();
            _httpRequestTimeout = settingsManager.GetHttpRequestTimeout();
            _httpReadWriteTimeout = settingsManager.GetHttpReadWriteTimeout();
        }
Ejemplo n.º 24
0
 public Client(string accessID, string secretKey, IHttpWebRequestFactory _httpWebRequestFactory = null)
 {
     Client.AccessID  = accessID;
     Client.SecretKey = secretKey;
     if (_httpWebRequestFactory == null)
     {
         Client.httpWebRequestFactory = new PayabbhiHttpWebRequestFactory();
     }
     else
     {
         Client.httpWebRequestFactory = _httpWebRequestFactory;
     }
 }
        public DeliciousQueryProviderTest()
        {
            delayer = mocks.StrictMock<IDelayer>();
            translatorFactory = mocks.StrictMock<IQueryTranslatorFactory>();
            translator = mocks.StrictMock<IQueryTranslator>();
            requestFactory = mocks.StrictMock<IHttpWebRequestFactory>();
            request = mocks.StrictMock<HttpWebRequest>();
            response = mocks.StrictMock<HttpWebResponse>();

            stream.Write(documentBytes, 0, documentBytes.Length);
            stream.Seek(0, SeekOrigin.Begin);

            provider = new DeliciousQueryProvider(requestFactory, delayer, translatorFactory);
        }
Ejemplo n.º 26
0
 public OssReportService(IReportRepository reportRepository, IComponentRepository componentRepository,
                         IOssIndexRepository ossIndexRepository, IReportLinesRepository reportLinesRepository,
                         ICoordinatesService coordinatesService, IHttpWebRequestFactory httpWebRequestFactory,
                         IJsonConvertService jsonConvertService, IOssIndexVulnerabilitiesRepository ossIndexVulnerabilitiesRepository)
 {
     _reportRepository                  = reportRepository;
     _componentRepository               = componentRepository;
     _ossIndexRepository                = ossIndexRepository;
     _reportLinesRepository             = reportLinesRepository;
     _coordinatesService                = coordinatesService;
     _httpWebRequestFactory             = httpWebRequestFactory;
     _jsonConvertService                = jsonConvertService;
     _ossIndexVulnerabilitiesRepository = ossIndexVulnerabilitiesRepository;
 }
        public SkillsHealthCheckService(IOptions <ShcSettings> settings, IHttpWebRequestFactory requestFactory)
        {
            Throw.IfNull(settings, nameof(settings));
            Throw.IfNullOrEmpty(settings.Value.Url, nameof(settings.Value.Url));
            Throw.IfNullOrEmpty(settings.Value.FindDocumentsAction, nameof(settings.Value.FindDocumentsAction));
            Throw.IfNullOrEmpty(settings.Value.SHCDocType, nameof(settings.Value.SHCDocType));
            Throw.IfNullOrEmpty(settings.Value.ServiceName, nameof(settings.Value.ServiceName));
            Throw.IfNullOrEmpty(settings.Value.LinkUrl, nameof(settings.Value.LinkUrl));

            Throw.IfNull(requestFactory, nameof(requestFactory));

            _settings = settings;
            _factory  = requestFactory;
        }
Ejemplo n.º 28
0
        public YouTrackBugService(IHttpWebRequestFactory httpFactory, string youtrackURL, string userName, string password)
        {
            _httpFactory = httpFactory;

            YOUTRACKURL          = youtrackURL.TrimEnd('\\').TrimEnd('/');
            LOGINURL             = YOUTRACKURL + "/rest/user/login";
            PROJECTLISTURL       = YOUTRACKURL + "/rest/project/all";
            BUGLISTURL           = YOUTRACKURL + "/rest/issue/byproject/{0}?after={1}&max={2}";
            COUNTURL             = YOUTRACKURL + "/rest/issue/count";
            COUNTBYPROJECTURL    = YOUTRACKURL + "/rest/issue/count?filter=project:{{{0}}}";
            BUGLISTWITHFILTERURL = YOUTRACKURL + "/rest/issue/byproject/{0}?after={1}&max={2}&filter={3}";
            APPLYCOMMANDURL      = YOUTRACKURL + "/rest/issue/{0}/execute";
            APPLYCOMMANDBODY     = "command={0}&disableNotifications={1}";

            _userName = userName;
            _password = password;
        }
Ejemplo n.º 29
0
        public YouTrackBugService(IHttpWebRequestFactory httpFactory, string youtrackURL, string userName, string password)
        {
            _httpFactory = httpFactory;

            YOUTRACKURL = youtrackURL.TrimEnd('\\').TrimEnd('/');
            LOGINURL = YOUTRACKURL + "/rest/user/login";
            PROJECTLISTURL = YOUTRACKURL + "/rest/project/all";
            BUGLISTURL = YOUTRACKURL + "/rest/issue/byproject/{0}?after={1}&max={2}";
            COUNTURL = YOUTRACKURL + "/rest/issue/count";
            COUNTBYPROJECTURL = YOUTRACKURL + "/rest/issue/count?filter=project:{{{0}}}";
            BUGLISTWITHFILTERURL = YOUTRACKURL + "/rest/issue/byproject/{0}?after={1}&max={2}&filter={3}:{4}";
            APPLYCOMMANDURL = YOUTRACKURL + "/rest/issue/{0}/execute";
            APPLYCOMMANDBODY = "command={0}&disableNotifications={1}";

            _userName = userName;
            _password = password;
        }
Ejemplo n.º 30
0
        // Protected members

        protected override Uri GetWebDriverUri(IWebBrowserInfo webBrowserInfo, IHttpWebRequestFactory webRequestFactory)
        {
            string releasesUrl = "https://github.com/mozilla/geckodriver/releases/latest";

            IGitHubClient gitHubClient = new GitHubWebClient(webRequestFactory);
            IRelease      release      = gitHubClient.GetLatestRelease(releasesUrl);

            IReleaseAsset asset = release.Assets.Where(a => a.Name.Contains(GetPlatformOS()))
                                  .FirstOrDefault();

            if (!string.IsNullOrWhiteSpace(asset?.DownloadUrl))
            {
                return(new Uri(asset.DownloadUrl));
            }

            // We weren't able to get information on the latest web driver.

            return(null);
        }
Ejemplo n.º 31
0
        /// <summary>
        /// Manages HTTP connection with Solr
        /// </summary>
        /// <param name="serverURL">URL to Solr</param>
        public SolrConnection(string serverURL)
        {
            ServerURL             = serverURL;
            Timeout               = -1;
            Cache                 = new NullCache();
            HttpWebRequestFactory = new HttpWebRequestFactory();
            if (ConfigurationManager.AppSettings["UseHttp"] == null || (ConfigurationManager.AppSettings["UseHttp"] != null && ConfigurationManager.AppSettings["UseHttp"].ToLower() != "true"))
            {
                var certificatePath     = ConfigurationManager.AppSettings["CertificatePath"];
                var certificatePassword = ConfigurationManager.AppSettings["CertificatePass"];

                if (string.IsNullOrEmpty(certificatePath))
                {
                    throw new ArgumentException("Path to certificate not set in web.config");
                }

                Certificate = new X509Certificate2(certificatePath, certificatePassword);
            }
        }
Ejemplo n.º 32
0
        public WebDriverFactory(IHttpWebRequestFactory webRequestFactory, IWebDriverOptions webDriverOptions, IWebDriverFactoryOptions webDriverFactoryOptions)
        {
            if (webDriverOptions is null)
            {
                throw new ArgumentNullException(nameof(webDriverOptions));
            }

            if (webDriverFactoryOptions is null)
            {
                throw new ArgumentNullException(nameof(webDriverFactoryOptions));
            }

            if (webRequestFactory is null)
            {
                throw new ArgumentNullException(nameof(webRequestFactory));
            }

            this.webRequestFactory       = webRequestFactory;
            this.webDriverOptions        = webDriverOptions;
            this.webDriverFactoryOptions = webDriverFactoryOptions;
        }
Ejemplo n.º 33
0
        public void Initialize()
        {
            _httpWebRequestFactory = new HttpWebRequestFactory();
            _streamReaderFactory = new StreamReaderFactory();
            _httpWebProcessor = new HttpWebProcessor(_streamReaderFactory);
            _httpWebProxyRequestFactory = new HttpWebProxyRequestFactory(_httpWebRequestFactory, _httpWebProcessor);
            _httpWebResponseFactory = new HttpWebResponseFactory();
            _httpWebProxy = new HttpWebProxy(_httpWebProxyRequestFactory, _httpWebResponseFactory, _httpWebProcessor);

            _httpWebRequestParametersGet = new HttpWebRequestParameters()
            {
                RequestUri = new Uri("http://httpbin.org/get"),
                ContentType = "*/*",
                Method = HttpMethod.Get,
                ReadWriteTimeout = 30000,
                Timeout = 30000,
                ResponseCallback = ResponseCallbackGet
            };

            var encoding = new ASCIIEncoding();
            _httpWebRequestParametersPost = new HttpWebRequestParameters()
            {
                RequestUri = new Uri("http://httpbin.org/post"),
                RequestData = POST_DATA_TEST,
                Encoding = encoding,
                ContentLength = POST_DATA_TEST.Length,
                ContentType = "*/*",
                Method = HttpMethod.Post,
                ReadWriteTimeout = 30000,
                Timeout = 30000,
                ResponseCallback = ResponseCallbackPost
            };

            _manualResetEventGet = new ManualResetEvent(false);
            _manualResetEventPost = new ManualResetEvent(false);
        }
        private IHttpWebRequest CreateSignedDuoWebRequest(IHttpWebRequestFactory webRequestFactory, string protocol, string path, HttpWebRequestMethod method, IEnumerable<KeyValuePair<string, string>> queryValues)
        {
            var duoWebRequest = CreateDuoWebRequest(webRequestFactory, protocol, path, method);

            var safeQueryString = CreateSafeQueryString(queryValues);

            var reg = new Regex(@"%[a-f0-9]{2}");
            var upperUrl = reg.Replace(safeQueryString, m => m.Value.ToUpperInvariant());

            SignWebRequest(duoWebRequest, method, path, upperUrl);

            if (method == HttpWebRequestMethod.POST) SetFormValuesForQuery(duoWebRequest, upperUrl);

            return duoWebRequest;
        }
 private IHttpWebRequest CreateDuoWebRequest(IHttpWebRequestFactory webRequestFactory, string protocol, string path, HttpWebRequestMethod method)
 {
     var duoWebRequest = webRequestFactory.Create(new Uri(string.Format(@"{0}://{1}{2}", protocol, _host, path)));
     duoWebRequest.Method = method;
     duoWebRequest.Accept = "application/json";
     duoWebRequest.Timeout = 3 * 60 * 1000;
     return duoWebRequest;
 }
Ejemplo n.º 36
0
 protected override IWebDriverUpdater GetUpdater(IHttpWebRequestFactory httpWebRequestFactory, IWebDriverUpdaterOptions webDriverUpdaterOptions)
 {
     return(new EdgeWebDriverUpdater(httpWebRequestFactory, webDriverUpdaterOptions));
 }
Ejemplo n.º 37
0
 public MockMirthConnectRequest(IHttpWebRequestFactory httpRequestFactory, string url)
     : base(httpRequestFactory, url)
 {
     this.httpRequestFactory = (MockHttpWebRequestFactory)httpRequestFactory;
 }
Ejemplo n.º 38
0
 public MockMirthConnectRequestFactory SetHttpWebRequestFactory(IHttpWebRequestFactory factory)
 {
     HttpWebRequestFactory = factory;
     return this;
 }
Ejemplo n.º 39
0
 protected WebClientBase(IHttpWebRequestFactory webRequestFactory, WebRequestHandler webRequestHandler) :
     this(webRequestFactory) {
     this.webRequestHandler = webRequestHandler;
 }
Ejemplo n.º 40
0
 public HttpDataGrabber(IHttpWebRequestFactory requestFactory, string userName, string password)
 {
     _userName = userName;
     _password = password;
     _requestFactory = requestFactory;
 }
Ejemplo n.º 41
0
        /// <summary>
        /// Creates a new CsqWebRequest for a URL using the provided IHttpWebRequestFactory. (Usually,
        /// you should use the default constructor, unless replacing the .NET framework HttpWebRequest
        /// object for testing or some other purpose)
        /// </summary>
        ///
        /// <param name="url">
        /// URL of the document.
        /// </param>
        /// <param name="webRequestFactory">
        /// The web request factory.
        /// </param>

        public CsqWebRequest(string url, IHttpWebRequestFactory webRequestFactory)
        {
            Url = url;
            WebRequestFactory = webRequestFactory;
        }
 /// <summary>
 /// Creates a new DeliciousQueryProvider.
 /// </summary>
 /// <param name="requestFactory">The factory for creating HttpWebRequest objects.</param>
 /// <param name="delayer">The IDelayer responsible for timing HTTP requests.</param>
 /// <param name="translatorFactory">The factory for creating IQueryTranslator objects.</param>
 public DeliciousQueryProvider(IHttpWebRequestFactory requestFactory, IDelayer delayer, IQueryTranslatorFactory translatorFactory)
 {
     mRequestFactory = requestFactory;
     mDelayer = delayer;
     mTranslatorFactory = translatorFactory;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ApiClient" /> class.
 /// </summary>
 /// <param name="logger">The logger.</param>
 /// <param name="requestFactory">The request factory.</param>
 public HttpWebRequestClient(ILogger logger, IHttpWebRequestFactory requestFactory)
 {
     Logger = logger;
     _requestFactory = requestFactory;
 }
Ejemplo n.º 44
0
 public SolrConnectionWrapper(string serverURL, IHttpWebRequestFactory httpWebRequestFactory)
     : this(serverURL)
 {
     this.HttpWebRequestFactory = httpWebRequestFactory;
 }
Ejemplo n.º 45
0
        private IHttpWebRequest CreateSignedDuoWebRequest(IHttpWebRequestFactory webRequestFactory, string protocol, string path, HttpWebRequestMethod method, IEnumerable<KeyValuePair<string, string>> queryValues)
        {
            var duoWebRequest = CreateDuoWebRequest(webRequestFactory, protocol, path, method);

            var safeQueryString = "message=Your%20PIN%20is%20%3Cpin%3E&phone=%2B447952556282"; // CreateSafeQueryString(queryValues);

            SignWebRequest(duoWebRequest, method, path, safeQueryString);

            if (method == HttpWebRequestMethod.POST) SetFormValuesForQuery(duoWebRequest, safeQueryString);

            return duoWebRequest;
        }
Ejemplo n.º 46
0
 public EarthquakeContainer(IHttpWebRequestFactory factory)
 {
     appSettings = new AppSettings();
     geonet = new GeonetAccessor(factory);
     geonet.GetQuakesCompletedEvent += QuakeListener;
 }
Ejemplo n.º 47
0
 public SeqBatchSender(SeqTraceListener associatedTraceListener, IHttpWebRequestFactory httpWebRequestFactory)
 {
     _associatedTraceListener = associatedTraceListener;
     _httpWebRequestFactory   = httpWebRequestFactory;
 }
Ejemplo n.º 48
0
 /// <summary>
 /// Manages HTTP connection with Solr
 /// </summary>
 /// <param name="serverURL">URL to Solr</param>
 public SolrConnection(string serverURL) {
     ServerURL = serverURL;
     Timeout = -1;
     Cache = new NullCache();
     HttpWebRequestFactory = new HttpWebRequestFactory();
 }
Ejemplo n.º 49
0
 public FirefoxWebDriverUpdater(IHttpWebRequestFactory webRequestFactory, IWebDriverUpdaterOptions webDriverUpdaterOptions) :
     base(WebBrowserId.Firefox, webRequestFactory, webDriverUpdaterOptions)
 {
 }
Ejemplo n.º 50
0
 public HttpRequestSender(IHttpWebRequestFactory httpWebRequestFactory)
 {
     Requires.NotNull(httpWebRequestFactory, "httpWebRequestFactory");
     _httpWebRequestFactory = httpWebRequestFactory;
 }
Ejemplo n.º 51
0
 public GeonetAccessor(IHttpWebRequestFactory webRequestFactory)
 {
     this.webRequestFactory = webRequestFactory;
     this.settings = new AppSettings();
 }
Ejemplo n.º 52
0
 public MirthConnectRequest(IHttpWebRequestFactory httpRequestFactory, string url)
 {
     this.httpRequestFactory = httpRequestFactory;
     this.url = url;
     this.postData = new Dictionary<string, string>();
 }
Ejemplo n.º 53
0
 public EdgeWebDriverFactory(IHttpWebRequestFactory webRequestFactory, IWebDriverOptions webDriverOptions, IWebDriverFactoryOptions webDriverFactoryOptions) :
     base(WebBrowserId.Edge, webRequestFactory, webDriverOptions, webDriverFactoryOptions)
 {
 }
 public HttpWebProxyRequestFactory(IHttpWebRequestFactory httpWebRequestFactory, IHttpWebProcessor httpWebProcessor)
 {
     _httpWebRequestFactory = httpWebRequestFactory;
     _httpWebProcessor = httpWebProcessor;
 }
Ejemplo n.º 55
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ApiClient" /> class.
 /// </summary>
 /// <param name="logger">The logger.</param>
 /// <param name="requestFactory">The request factory.</param>
 public HttpWebRequestClient(ILogger logger, IHttpWebRequestFactory requestFactory)
 {
     Logger          = logger;
     _requestFactory = requestFactory;
 }
Ejemplo n.º 56
0
        private IHttpWebRequest CreateSignedDuoWebRequest(IHttpWebRequestFactory webRequestFactory, string protocol, string path, HttpWebRequestMethod method, IEnumerable<KeyValuePair<string, string>> queryValues)
        {
            queryValues = queryValues.OrderBy(item => item.Key);
            var duoWebRequest = CreateDuoWebRequest(webRequestFactory, protocol, path, method);

            var safeQueryString = CreateSafeQueryString(queryValues);

            SignWebRequest(duoWebRequest, method, path, safeQueryString);

            if (method == HttpWebRequestMethod.POST) SetFormValuesForQuery(duoWebRequest, safeQueryString);

            return duoWebRequest;
        }