module

Fetcher::HeaderBuilder

Constants

DEFAULT_ACCEPT_HEADER = "application/rss+xml, application/atom+xml, application/xml;q=0.9, text/xml;q=0.8, */*;q=0.7"
DEFAULT_USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"

Class methods

build(custom_headers : HTTP::Headers = ::HTTP::Headers.new) : HTTP::Headers
Source
build_for_crest(custom_headers : HTTP::Headers = ::HTTP::Headers.new) : Hash(String, String)
Source
with_cache(base : HTTP::Headers, etag : String | Nil, last_modified : String | Nil) : HTTP::Headers

Add conditional If-None-Match / If-Modified-Since headers so a client can revalidate against a previously-issued ETag or Last-Modified value. Both arguments are optional; the corresponding header is only added when the value is present.

Source