Exemple #1
0
        public void AddField <T>(string name, T value, MimeType mediaType)
        {
            name.AssertNotNull(nameof(name));
            mediaType.AssertNotNull(nameof(mediaType));

            _fields.Insert(0, new RequestFormField(name, RestValue.Create(value), mediaType));
        }
Exemple #2
0
        public RestClientBuilder WithDefaultRequestSegment <T>(string name, T value)
        {
            name.AssertNotNullOrEmpty(nameof(name));

            var segment = new RequestRouteSegment(name, RestValue.Create(value));

            _container.Register(new RequestEnricher(x => x.AddRouteSegment(segment)));

            return(this);
        }
Exemple #3
0
        public RestClientBuilder WithDefaultRequestQuery <T>(string name, T value)
        {
            name.AssertNotNullOrEmpty(nameof(name));

            var query = new RequestQuery(name, RestValue.Create(value));

            _container.Register(new RequestEnricher(x => x.AddQuery(query)));

            return(this);
        }
Exemple #4
0
        public void AddQuery <T>(string name, T value)
        {
            name.AssertNotNullOrEmpty(nameof(name));

            AddQuery(new RequestQuery(name, RestValue.Create(value)));
        }
Exemple #5
0
        public void AddRouteSegment <T>(string name, T value)
        {
            name.AssertNotNullOrEmpty(nameof(name));

            AddRouteSegment(new RequestRouteSegment(name, RestValue.Create(value)));
        }