Ejemplo n.º 1
0
        internal HttpClient(
            string rootUrl,
            HttpClientSettings settings,
            IRequestRunner requestRunner)
        {
            this.settings = settings;

            settings.Validate();

            this.requestRunner = requestRunner;

            merger = new ResourceMerger(settings.NamingConvention);

            Root = Resource.Create(rootUrl);
        }
Ejemplo n.º 2
0
        internal HttpClient(string rootUrl, HttpClientSettings settings)
        {
            this.settings = settings;

            settings.Validate();

            var cookieContainer = new CookieContainer();
            var client          = BuildSystemClient(cookieContainer, settings.DefaultTimeout);

            requestRunner = new RequestRunner(
                client,
                new TransmissionSettings(settings.Serializers),
                settings.ArrayFormatter,
                cookieContainer,
                settings.Middleware);

            merger = new ResourceMerger(settings.NamingConvention);

            Root = Resource.Create(rootUrl);
        }