The values of HTTP headers as data: the header maps of responses, links, media types, byte ranges, and when to ask again.
A map of headers has lower-case names, and each value is a string or a vector of strings.
The values of HTTP headers as data: the header maps of responses, links, media types, byte ranges, and when to ask again. A map of headers has lower-case names, and each value is a string or a vector of strings.
(byte-ranges s)The byte ranges that the Range header value s asks for, as RFC 9110,
section 14.1.2, reads them. Nil when s doesn't read, because a server
then ignores it.
A value such as bytes=0-1023, 5000- asks for two ranges. A range is a pair of its start and its end, with the end included, or nil for the rest of the file. A nil start and an end of n ask for the last n bytes.
The byte ranges that the Range header value `s` asks for, as RFC 9110, section 14.1.2, reads them. Nil when `s` doesn't read, because a server then ignores it. A value such as bytes=0-1023, 5000- asks for two ranges. A range is a pair of its start and its end, with the end included, or nil for the rest of the file. A nil start and an end of n ask for the last n bytes.
(charset headers)The charset that the Content-Type of the response headers names, or
nil.
The charset that the Content-Type of the response `headers` names, or nil.
(content-range s)The byte range and the size of the whole file that the Content-Range
header value s names, e.g. bytes 0-1023/146515, as a map of :start,
:end and :total.
It's nil when s doesn't read, and the :total is nil when the server
doesn't know the size.
The byte range and the size of the whole file that the Content-Range header value `s` names, e.g. bytes 0-1023/146515, as a map of :start, :end and :total. It's nil when `s` doesn't read, and the :total is nil when the server doesn't know the size.
(gzipped? headers)Whether the response with headers says that its body is gzipped.
Whether the response with `headers` says that its body is gzipped.
(header headers header-name)The first value of header-name in the response headers map headers,
whose values are strings or vectors of them.
The first value of `header-name` in the response headers map `headers`, whose values are strings or vectors of them.
(joined headers header-name)All the values of header-name in the response headers map headers,
joined by commas as fetch joins them, or nil for none.
All the values of `header-name` in the response headers map `headers`, joined by commas as fetch joins them, or nil for none.
(links headers)The links of the Link header in the response headers, as section 3
of RFC 8288 defines them.
Each link is a map with its target as :href, and with its parameters by name, e.g. :rel and :type. The links are in the order of the header. The first value of a parameter counts, and a target can be relative to the URL of the response.
The links of the Link header in the response `headers`, as section 3 of RFC 8288 defines them. Each link is a map with its target as :href, and with its parameters by name, e.g. :rel and :type. The links are in the order of the header. The first value of a parameter counts, and a target can be relative to the URL of the response.
(media-type s)The media type of the Content-Type value s, or of a type attribute,
or nil when s names none.
The media type is in lower case, without its parameters.
The media type of the Content-Type value `s`, or of a type attribute, or nil when `s` names none. The media type is in lower case, without its parameters.
(not-before headers at)(not-before headers at {:keys [max-wait-seconds] :as opts})The earliest instant to ask again, by the response headers that
arrived at at, with the wait capped at the :max-wait-seconds of opts.
The instant comes from the first of these that the headers give: the Retry-After, the max-age of Cache-Control less the Age, or the Expires. It's nil when they name no later time or forbid a cache. A date counts from the Date of the response so that a wrong clock on the server doesn't matter (RFC 9111, section 4.2.1).
The earliest instant to ask again, by the response `headers` that arrived at `at`, with the wait capped at the :max-wait-seconds of `opts`. The instant comes from the first of these that the headers give: the Retry-After, the max-age of Cache-Control less the Age, or the Expires. It's nil when they name no later time or forbid a cache. A date counts from the Date of the response so that a wrong clock on the server doesn't matter (RFC 9111, section 4.2.1).
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |