예제 #1
0
        public Task <IResponse> Get(string url, Action <IRequest> prepareRequest, bool isLongRunning)
        {
            return(HttpHelper.GetAsync(url, request =>
            {
                request.ConnectionGroupName = isLongRunning ? _longRunningGroup : _shortRunningGroup;

                var req = new HttpWebRequestWrapper(request);
                prepareRequest(req);
                PrepareClientRequest(req);
            }).Then(response => (IResponse) new HttpWebResponseWrapper(response)));
        }
예제 #2
0
        public Task<IResponse> Get(string url, Action<IRequest> prepareRequest, bool isLongRunning)
        {
            return HttpHelper.GetAsync(url, request =>
            {
                request.ConnectionGroupName = isLongRunning ? _longRunningGroup : _shortRunningGroup;

                var req = new HttpWebRequestWrapper(request);
                prepareRequest(req);
                PrepareClientRequest(req);
            }).Then(response => (IResponse) new HttpWebResponseWrapper(response));
        }
예제 #3
0
        private void PrepareClientRequest(HttpWebRequestWrapper req)
        {
            // todo: add certificates

            if (_connection.CookieContainer != null)
            {
                req.CookieContainer = _connection.CookieContainer;
            }

            if (_connection.Credentials != null)
            {
                req.Credentials = _connection.Credentials;
            }

            // todo: add proxy
        }
예제 #4
0
        private void PrepareClientRequest(HttpWebRequestWrapper req)
        {
            // todo: add certificates

            if (_connection.CookieContainer != null)
            {
                req.CookieContainer = _connection.CookieContainer;
            }

            if (_connection.Credentials != null)
            {
                req.Credentials = _connection.Credentials;
            }

            // todo: add proxy
        }