Exemple #1
0
        private Uri BuildUri()
        {
            var builder = new UriBuilder(_httpActionContext.Url());
            var query   = HttpUtility.ParseQueryString(builder.Query);

            query.Add(_setupContext.Queries());

            builder.Query = query.ToQueryString();
            return(new Uri(builder.ToString()));
        }
        private Uri BuildUri()
        {
            var builder = new UriBuilder(_httpActionContext.Url());
            var query   = HttpUtility.ParseQueryString(builder.Query);

            foreach (var queryString in _setupContext.Queries())
            {
                query.Add(queryString.Key, queryString.Value);
            }

            builder.Query = query.ToString();
            return(new Uri(builder.ToString()));
        }
Exemple #3
0
        /// <summary>
        /// Deep copy of this object
        /// </summary>
        /// <returns></returns>
        public SetupContext Clone()
        {
            var setupContext = new SetupContext()
                               .Name(_name)
                               .Host(_host)
                               .Uri(_uri)
                               .Body(_body)
                               .HttpClient(_httpClient);

            setupContext.Headers(_headers);

            setupContext.Queries(_queryStrings);

            setupContext.Params(_parameters);

            foreach (var file in _files)
            {
                setupContext.File(file.FileName, file.ContentDispositionName, file.ContentType, file.Content);
            }

            return(setupContext);
        }