| | | 1 | | |
| | | 2 | | using System.Net; |
| | | 3 | | |
| | | 4 | | namespace Kestrun.Client; |
| | | 5 | | |
| | | 6 | | /// <summary>Extra options to shape HttpClient behavior.</summary> |
| | | 7 | | public sealed class KrHttpClientOptions |
| | | 8 | | { |
| | | 9 | | /// <summary>Overall request timeout (HttpClient.Timeout). Default 100s.</summary> |
| | 0 | 10 | | public TimeSpan Timeout { get; set; } = TimeSpan.FromSeconds(100); |
| | | 11 | | |
| | | 12 | | /// <summary>Accept any server certificate (for dev/self-signed).</summary> |
| | 0 | 13 | | public bool IgnoreCertErrors { get; set; } = false; |
| | | 14 | | |
| | | 15 | | /// <summary>Automatic decompression (gzip/deflate/br). Default: All.</summary> |
| | 0 | 16 | | public DecompressionMethods Decompression { get; set; } = DecompressionMethods.All; |
| | | 17 | | |
| | | 18 | | /// <summary>Cookies to use (enables UseCookies when non-null).</summary> |
| | 0 | 19 | | public CookieContainer? Cookies { get; set; } = null; |
| | | 20 | | |
| | | 21 | | /// <summary>Follow redirects automatically. Default: true.</summary> |
| | 0 | 22 | | public bool AllowAutoRedirect { get; set; } = true; |
| | | 23 | | |
| | | 24 | | /// <summary>Max redirects when AllowAutoRedirect = true. Default: 50.</summary> |
| | 0 | 25 | | public int MaxAutomaticRedirections { get; set; } = 50; |
| | | 26 | | |
| | | 27 | | /// <summary>Server credentials; ignored if UseDefaultCredentials = true.</summary> |
| | 0 | 28 | | public ICredentials? Credentials { get; set; } = null; |
| | | 29 | | |
| | | 30 | | /// <summary>Use current user’s credentials for server auth.</summary> |
| | 0 | 31 | | public bool UseDefaultCredentials { get; set; } = false; |
| | | 32 | | |
| | | 33 | | /// <summary>Proxy to use. Set UseProxy = true to enable.</summary> |
| | 0 | 34 | | public IWebProxy? Proxy { get; set; } = null; |
| | | 35 | | |
| | | 36 | | /// <summary>Whether to use a proxy handler.</summary> |
| | 0 | 37 | | public bool UseProxy { get; set; } = false; |
| | | 38 | | |
| | | 39 | | /// <summary>Use current user’s credentials for proxy auth.</summary> |
| | 0 | 40 | | public bool ProxyUseDefaultCredentials { get; set; } = false; |
| | | 41 | | } |