class

Fetcher::RequestConfig

Inherits Reference < Object

Constructors

new(timeout : TimeoutConfig = TimeoutConfig.new, retry : RetryConfig = RetryConfig.new, circuit_breaker : CircuitBreakerConfig = CircuitBreakerConfig.new, rate_limit : RateLimitConfig = RateLimitConfig.new, streaming : StreamingConfig = StreamingConfig.new, cache_config : CacheConfig = CacheConfig.new, dns : DnsConfig = DnsConfig.new, content : ContentConfig = ContentConfig.new, redirect : RedirectConfig = RedirectConfig.new, max_redirects : Int32 = 5, follow_redirects : Bool = true, ssl_verify : Bool = true, driver_detection_mode : DriverDetectionMode = DriverDetectionMode::Auto, error_detail_level : ErrorDetailLevel = ErrorDetailLevel::Normal, max_concurrent_requests : Int32 | Nil = nil, ssl_verify_bypass_acknowledged : Bool = false, gitlab_token : String | Nil = nil, codeberg_token : String | Nil = nil, reddit_client_id : String | Nil = nil, reddit_client_secret : String | Nil = nil, reddit_username : String | Nil = nil, reddit_password : String | Nil = nil)
Source

Instance methods

cache
Source
cache_config
Source
circuit_breaker
Source
close

Close resources held by this config, including the Cache owner fiber. Call this when the config is no longer needed to prevent fiber leaks.

Source
codeberg_token
Source
content
Source
delay_for_attempt(attempt : Int32) : Time::Span
Source
driver_detection_mode
Source
error_detail_level
Source
follow_redirects?
Source
gitlab_token
Source
max_concurrent_requests
Source
max_redirects
Source
rate_limit
Source
reddit_client_id
Source
reddit_client_secret
Source
reddit_password
Source
reddit_username
Source
redirect
Source
retry
Source
ssl_verify?
Source
ssl_verify_bypass_acknowledged
Source
streaming
Source
timeout
Source
with_redirect_allowed_domains(domains : Array(String)) : RequestConfig

Return a copy of this RequestConfig with specific allowed domains for redirects.

Source
with_retry_max_retries(max_retries : Int32) : RequestConfig

Return a copy of this RequestConfig with the retry.max_retries overridden.

Source