コード例 #1
0
        public static IAdvancedHttpBuilder WithAutoDecompression(this IAdvancedHttpBuilder builder, bool enabled = true)

        {
            builder.WithConfiguration(s => s.AutoDecompression = true);

            return(builder.WithClientConfiguration(c => c.WithDecompressionMethods(enabled
                    ? DecompressionMethods.GZip | DecompressionMethods.Deflate
                    : DecompressionMethods.None)));
        }
コード例 #2
0
        public static IAdvancedHttpBuilder WithTimeout(this IAdvancedHttpBuilder builder, TimeSpan?timeout)

        {
            return(builder.WithClientConfiguration(c => c.WithTimeout(timeout)));
        }
コード例 #3
0
        public static IAdvancedHttpBuilder WithAppendHeader(this IAdvancedHttpBuilder builder, string name, IEnumerable <string> values)

        {
            return(builder.WithClientConfiguration(c => c.WithAppendHeader(name, values)));
        }
コード例 #4
0
        public static IAdvancedHttpBuilder WithHeader(this IAdvancedHttpBuilder builder, string name, string value)

        {
            return(builder.WithClientConfiguration(c => c.WithHeader(name, value)));
        }
コード例 #5
0
 public static IAdvancedHttpBuilder WithHeadersConfiguration(this IAdvancedHttpBuilder builder, Action <HttpRequestHeaders> configuration)
 {
     return(builder.WithClientConfiguration(c => c.WithHeadersConfiguration(configuration)));
 }
コード例 #6
0
        public static IAdvancedHttpBuilder WithNoCache(this IAdvancedHttpBuilder builder, bool nocache = true)

        {
            return(builder.WithClientConfiguration(c => c.WithNoCache(nocache)));
        }