Exemplo n.º 1
0
        public static IFlurlRequest ConfigureRequestArkDefaults(this IFlurlRequest request)
        {
            return(request.ConfigureRequest(s =>
            {
                var jsonSettings = new ArkJsonSerializerSettings();

                s.JsonSerializer = new NewtonsoftJsonSerializer(jsonSettings);

                s.Timeout = TimeSpan.FromMinutes(5);
                s.AllowedHttpStatusRange = "*";
            }));
        }
Exemplo n.º 2
0
        public static IFlurlClient ConfigureArkDefaults(this IFlurlClient client)
        {
            client.AllowAnyHttpStatus();
            return(client.Configure(s =>
            {
                s.CookiesEnabled = true;
                s.HttpClientFactory = ArkHttpClientFactory.Instance;
                var jsonSettings = new ArkJsonSerializerSettings();

                s.JsonSerializer = new NewtonsoftJsonSerializer(jsonSettings);

                s.ConnectionLeaseTimeout = TimeSpan.FromMinutes(60);
                s.Timeout = TimeSpan.FromMinutes(5);
            }));
        }
Exemplo n.º 3
0
        public static IFlurlClient ConfigureArkDefaults(this IFlurlClient client)
        {
            var j = new CookieJar();

            client.AllowAnyHttpStatus();
            return(client.Configure(s =>
            {
                s.BeforeCall += c => c.Request.WithCookies(j);
                s.HttpClientFactory = ArkHttpClientFactory.Instance;
                var jsonSettings = new ArkJsonSerializerSettings();

                s.JsonSerializer = new NewtonsoftJsonSerializer(jsonSettings);

                s.ConnectionLeaseTimeout = TimeSpan.FromMinutes(60);
                s.Timeout = TimeSpan.FromMinutes(5);
            }));
        }
Exemplo n.º 4
0
        public static IFlurlClient ConfigureArkDefaults(this IFlurlClient client)
        {
            var j = new CookieJar();

            client.AllowAnyHttpStatus();
            return(client.Configure(s =>
            {
                s.BeforeCall += c => c.Request
                                .WithCookies(j)
#if NET5_0_OR_GREATER
                                .WithHeader("Accept-Encoding", "gzip, deflate, br")
#else
                                .WithHeader("Accept-Encoding", "gzip, deflate")
#endif
                ;
                s.HttpClientFactory = ArkHttpClientFactory.Instance;
                var jsonSettings = new ArkJsonSerializerSettings();

                s.JsonSerializer = new NewtonsoftJsonSerializer(jsonSettings);

                s.ConnectionLeaseTimeout = TimeSpan.FromMinutes(60);
                s.Timeout = TimeSpan.FromMinutes(5);
            }));
        }