class

Fetcher::CrestHttpClient

Inherits Reference < Object

Constructors

new(config : RequestConfig = RequestConfig.new, validator : URLValidator::Service = URLValidator.default_service)
Source

Class methods

build_headers(custom_headers : HTTP::Headers = ::HTTP::Headers.new) : HTTP::Headers
Source
clear_rate_limiters
Source
ensure_decompressed(body : String) : String

Defensive decompression: some servers (especially behind CDNs like Vercel/Cloudflare) send gzip-compressed bodies without a proper Content-Encoding header. Crystal's auto-decompress relies on that header, so we check for gzip magic bytes (\x1f\x08b) manually.

Source
with_cache(base : HTTP::Headers, etag : String | Nil, last_modified : String | Nil) : HTTP::Headers
Source

Instance methods

clear_dns_cache
Source

Nested types